home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1996-05-28 | 62.6 KB | [TEXT/CWIE] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: Assign.c
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue May 28 22:09:41 1996, modified Tue May 28 22:09:41 1996, creator 'CWIE', type ASCII, 60887 bytes "Assign.c" , at 0xee57 3012 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 41 73 73 69 67 6e | 2e 63 00 00 00 00 00 00 |..Assign|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 ed d7 00 | 00 0b c4 ad d1 62 65 ad |........|.....be.|
|00000060| d1 62 65 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.be.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 78 e1 00 00 |........|....x...|
|00000080| 2f 2a 0d 41 73 73 69 67 | 6e 2e 63 0d 0d 41 73 73 |/*.Assig|n.c..Ass|
|00000090| 69 67 6e 20 69 73 20 61 | 20 70 6f 72 74 61 62 6c |ign is a| portabl|
|000000a0| 65 20 72 75 6e 74 69 6d | 65 20 43 20 69 6e 74 65 |e runtim|e C inte|
|000000b0| 72 70 72 65 74 65 72 20 | 74 68 61 74 20 72 65 61 |rpreter |that rea|
|000000c0| 64 73 20 61 6e 64 20 65 | 78 65 63 75 74 65 73 20 |ds and e|xecutes |
|000000d0| 61 6e 79 20 74 65 78 74 | 0d 22 61 73 73 69 67 6e |any text|."assign|
|000000e0| 6d 65 6e 74 22 20 66 69 | 6c 65 20 74 68 61 74 20 |ment" fi|le that |
|000000f0| 63 6f 6e 74 61 69 6e 73 | 20 6f 6e 6c 79 20 43 20 |contains| only C |
|00000100| 61 73 73 69 67 6e 6d 65 | 6e 74 73 20 61 6e 64 20 |assignme|nts and |
|00000110| 63 6f 6d 6d 65 6e 74 73 | 2c 20 65 2e 67 2e 0d 09 |comments|, e.g...|
|00000120| 76 69 65 77 69 6e 67 44 | 69 73 74 61 6e 63 65 3d |viewingD|istance=|
|00000130| 35 37 2e 30 3b 09 2f 2f | 20 69 6e 63 68 65 73 0d |57.0;.//| inches.|
|00000140| 09 0d 53 65 65 20 41 73 | 73 69 67 6e 2e 6e 6f 74 |..See As|sign.not|
|00000150| 65 20 66 6f 72 20 64 6f | 63 75 6d 65 6e 74 61 74 |e for do|cumentat|
|00000160| 69 6f 6e 2e 0d 0d 28 49 | 74 20 77 6f 75 6c 64 20 |ion...(I|t would |
|00000170| 62 65 20 6e 69 63 65 20 | 74 6f 20 61 64 64 20 61 |be nice |to add a|
|00000180| 20 66 6c 61 67 20 66 6f | 72 20 50 72 69 6e 74 41 | flag fo|r PrintA|
|00000190| 73 73 69 67 6e 6d 65 6e | 74 73 54 6f 46 69 6c 65 |ssignmen|tsToFile|
|000001a0| 28 29 20 74 68 61 74 20 | 77 6f 75 6c 64 20 72 65 |() that |would re|
|000001b0| 71 75 65 73 74 0d 61 20 | 72 65 61 64 2d 61 66 74 |quest.a |read-aft|
|000001c0| 65 72 2d 77 72 69 74 65 | 20 63 68 65 63 6b 2c 20 |er-write| check, |
|000001d0| 61 6c 61 20 57 72 69 74 | 65 4c 75 6d 69 6e 61 6e |ala Writ|eLuminan|
|000001e0| 63 65 52 65 63 6f 72 64 | 20 69 6e 20 52 65 61 64 |ceRecord| in Read|
|000001f0| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 2e |Luminanc|eRecord.|
|00000200| 63 2e 29 0d 0d 48 49 53 | 54 4f 52 59 0d 37 2f 33 |c.)..HIS|TORY.7/3|
|00000210| 30 2f 39 31 20 64 67 70 | 09 77 72 6f 74 65 20 69 |0/91 dgp|.wrote i|
|00000220| 74 20 61 73 20 22 52 65 | 61 64 41 73 73 69 67 6e |t as "Re|adAssign|
|00000230| 6d 65 6e 74 73 2e 63 22 | 2e 0d 38 2f 34 2f 39 31 |ments.c"|..8/4/91|
|00000240| 09 64 67 70 20 61 64 64 | 65 64 20 6e 65 77 20 72 |.dgp add|ed new r|
|00000250| 6f 75 74 69 6e 65 73 20 | 61 6e 64 20 72 65 6e 61 |outines |and rena|
|00000260| 6d 65 64 20 74 68 65 20 | 6f 6c 64 20 6f 6e 65 73 |med the |old ones|
|00000270| 2e 20 45 76 65 72 79 74 | 68 69 6e 67 0d 09 09 09 |. Everyt|hing....|
|00000280| 73 65 65 6d 73 20 74 6f | 20 77 6f 72 6b 2c 20 62 |seems to| work, b|
|00000290| 75 74 20 68 61 73 20 6e | 6f 74 20 62 65 65 6e 20 |ut has n|ot been |
|000002a0| 74 68 6f 72 6f 75 67 68 | 6c 79 20 74 65 73 74 65 |thorough|ly teste|
|000002b0| 64 2e 0d 38 2f 35 2f 39 | 31 09 64 67 70 09 4d 50 |d..8/5/9|1.dgp.MP|
|000002c0| 57 20 43 20 33 2e 32 20 | 6e 6f 77 20 63 6f 6d 70 |W C 3.2 |now comp|
|000002d0| 69 6c 65 73 20 69 74 20 | 77 69 74 68 6f 75 74 20 |iles it |without |
|000002e0| 65 72 72 6f 72 20 6d 65 | 73 73 61 67 65 73 2e 20 |error me|ssages. |
|000002f0| 54 68 65 20 4d 50 57 20 | 43 20 6d 61 63 72 6f 20 |The MPW |C macro |
|00000300| 70 72 6f 63 65 73 73 6f | 72 2c 0d 09 09 09 63 6f |processo|r,....co|
|00000310| 6e 74 72 61 72 79 20 74 | 6f 20 53 74 61 6e 64 61 |ntrary t|o Standa|
|00000320| 72 64 20 43 2c 20 66 69 | 6e 64 73 20 63 6f 6d 6d |rd C, fi|nds comm|
|00000330| 65 6e 74 20 73 79 6d 62 | 6f 6c 73 20 69 6e 73 69 |ent symb|ols insi|
|00000340| 64 65 20 73 74 72 69 6e | 67 73 20 61 6e 64 20 66 |de strin|gs and f|
|00000350| 69 6e 64 73 20 0d 09 09 | 09 70 72 65 70 72 6f 63 |inds ...|.preproc|
|00000360| 65 73 73 6f 72 20 64 69 | 72 65 63 74 69 76 65 73 |essor di|rectives|
|00000370| 20 65 76 65 6e 20 77 68 | 65 6e 20 23 20 69 73 20 | even wh|en # is |
|00000380| 6e 6f 74 20 74 68 65 20 | 66 69 72 73 74 20 6e 6f |not the |first no|
|00000390| 6e 62 6c 61 6e 6b 20 63 | 68 61 72 61 63 74 65 72 |nblank c|haracter|
|000003a0| 2e 0d 38 2f 32 34 2f 39 | 31 09 64 67 70 09 4d 61 |..8/24/9|1.dgp.Ma|
|000003b0| 64 65 20 63 6f 6d 70 61 | 74 69 62 6c 65 20 77 69 |de compa|tible wi|
|000003c0| 74 68 20 54 48 49 4e 4b | 20 43 20 35 2e 30 2e 0d |th THINK| C 5.0..|
|000003d0| 09 09 09 43 68 61 6e 67 | 65 64 20 52 65 61 64 41 |...Chang|ed ReadA|
|000003e0| 73 73 69 67 6e 6d 65 6e | 74 20 66 69 6c 65 20 74 |ssignmen|t file t|
|000003f0| 6f 20 72 65 74 75 72 6e | 20 61 6e 20 65 72 72 6f |o return| an erro|
|00000400| 72 20 63 6f 64 65 20 69 | 6e 73 74 65 61 64 20 6f |r code i|nstead o|
|00000410| 66 20 61 62 6f 72 74 69 | 6e 67 0d 09 09 09 69 66 |f aborti|ng....if|
|00000420| 20 69 74 20 63 61 6e 27 | 74 20 6f 70 65 6e 20 74 | it can'|t open t|
|00000430| 68 65 20 66 69 6c 65 2e | 0d 38 2f 32 36 2f 39 31 |he file.|.8/26/91|
|00000440| 09 64 67 70 09 41 64 64 | 65 64 20 53 65 74 56 61 |.dgp.Add|ed SetVa|
|00000450| 72 69 61 62 6c 65 28 29 | 20 61 6e 64 20 6e 6f 74 |riable()| and not|
|00000460| 65 64 2c 20 69 6e 20 41 | 73 73 69 67 6e 2e 6e 6f |ed, in A|ssign.no|
|00000470| 74 65 2c 20 74 68 61 74 | 20 74 68 65 20 56 61 72 |te, that| the Var|
|00000480| 69 61 62 6c 65 20 61 72 | 72 61 79 0d 09 09 09 69 |iable ar|ray....i|
|00000490| 73 20 74 65 72 6d 69 6e | 61 74 65 64 20 62 79 20 |s termin|ated by |
|000004a0| 61 6e 20 65 6c 65 6d 65 | 6e 74 20 77 69 74 68 20 |an eleme|nt with |
|000004b0| 69 74 73 20 22 74 79 70 | 65 22 20 66 69 65 6c 64 |its "typ|e" field|
|000004c0| 20 73 65 74 20 74 6f 20 | 7a 65 72 6f 2e 20 28 54 | set to |zero. (T|
|000004d0| 68 61 6e 6b 73 0d 09 09 | 09 74 6f 20 45 76 61 6e |hanks...|.to Evan|
|000004e0| 20 52 65 6c 6b 69 6e 20 | 66 6f 72 20 70 6f 69 6e | Relkin |for poin|
|000004f0| 74 69 6e 67 20 6f 75 74 | 20 74 68 65 20 6f 6d 69 |ting out| the omi|
|00000500| 73 73 69 6f 6e 2e 29 0d | 34 2f 31 2f 39 32 09 64 |ssion.).|4/1/92.d|
|00000510| 67 70 09 54 69 64 69 65 | 64 20 75 70 20 41 73 73 |gp.Tidie|d up Ass|
|00000520| 69 67 6e 2e 6e 6f 74 65 | 2e 0d 34 2f 32 2f 39 32 |ign.note|..4/2/92|
|00000530| 09 64 67 70 20 49 6e 74 | 72 6f 64 75 63 65 64 20 |.dgp Int|roduced |
|00000540| 52 65 61 64 41 73 73 69 | 67 6e 6d 65 6e 74 42 6c |ReadAssi|gnmentBl|
|00000550| 6f 63 6b 28 29 20 61 6e | 64 20 41 73 73 69 67 6e |ock() an|d Assign|
|00000560| 6d 65 6e 74 4c 69 6e 65 | 57 61 73 42 6c 61 6e 6b |mentLine|WasBlank|
|00000570| 28 29 2e 20 0d 09 09 09 | 44 65 6c 65 74 65 64 20 |(). ....|Deleted |
|00000580| 52 65 61 64 41 73 73 69 | 67 6e 6d 65 6e 74 73 28 |ReadAssi|gnments(|
|00000590| 29 2e 0d 34 2f 35 2f 39 | 32 09 64 67 70 09 52 65 |)..4/5/9|2.dgp.Re|
|000005a0| 61 64 41 73 73 69 67 6e | 6d 65 6e 74 46 69 6c 65 |adAssign|mentFile|
|000005b0| 28 29 20 6e 6f 77 20 63 | 6c 6f 73 65 73 20 74 68 |() now c|loses th|
|000005c0| 65 20 66 69 6c 65 20 62 | 65 66 6f 72 65 20 72 65 |e file b|efore re|
|000005d0| 74 75 72 6e 69 6e 67 2e | 0d 34 2f 31 37 2f 39 32 |turning.|.4/17/92|
|000005e0| 09 64 67 70 09 45 78 70 | 61 6e 64 65 64 20 74 68 |.dgp.Exp|anded th|
|000005f0| 65 20 65 78 70 6c 61 6e | 61 74 69 6f 6e 20 6f 66 |e explan|ation of|
|00000600| 20 66 6c 61 67 73 2c 20 | 61 73 20 72 65 71 75 65 | flags, |as reque|
|00000610| 73 74 65 64 20 62 79 20 | 45 76 61 6e 20 52 65 6c |sted by |Evan Rel|
|00000620| 6b 69 6e 2e 0d 35 2f 31 | 34 2f 39 32 09 64 67 70 |kin..5/1|4/92.dgp|
|00000630| 09 45 78 70 61 6e 64 65 | 64 20 74 68 65 20 65 78 |.Expande|d the ex|
|00000640| 70 6c 61 6e 61 74 69 6f | 6e 20 6f 66 20 73 74 72 |planatio|n of str|
|00000650| 69 6e 67 54 79 70 65 2c | 20 22 22 2e 0d 38 2f 34 |ingType,| ""..8/4|
|00000660| 2f 39 32 09 64 67 70 09 | 41 64 64 65 64 20 50 72 |/92.dgp.|Added Pr|
|00000670| 69 6e 74 41 6e 41 73 73 | 69 67 6e 6d 65 6e 74 28 |intAnAss|ignment(|
|00000680| 29 2c 20 77 68 69 63 68 | 20 70 72 69 6e 74 73 20 |), which| prints |
|00000690| 6f 75 74 20 74 68 65 20 | 76 61 6c 75 65 20 6f 66 |out the |value of|
|000006a0| 20 61 20 76 61 72 69 61 | 62 6c 65 2c 0d 09 09 09 | a varia|ble,....|
|000006b0| 61 73 20 61 6e 20 61 73 | 73 69 67 6e 6d 65 6e 74 |as an as|signment|
|000006c0| 20 73 74 61 74 65 6d 65 | 6e 74 2c 20 73 75 69 74 | stateme|nt, suit|
|000006d0| 61 62 6c 65 20 66 6f 72 | 20 72 65 61 64 69 6e 67 |able for| reading|
|000006e0| 20 62 79 20 74 68 65 20 | 52 65 61 64 41 73 73 69 | by the |ReadAssi|
|000006f0| 67 6e 6d 65 6e 74 0d 09 | 09 09 72 6f 75 74 69 6e |gnment..|..routin|
|00000700| 65 73 2e 0d 31 30 2f 32 | 34 2f 39 32 20 64 67 70 |es..10/2|4/92 dgp|
|00000710| 20 45 6c 69 6d 69 6e 61 | 74 65 64 20 64 6f 75 62 | Elimina|ted doub|
|00000720| 6c 65 20 73 70 61 63 69 | 6e 67 20 74 68 61 74 20 |le spaci|ng that |
|00000730| 6f 63 63 75 72 72 65 64 | 20 61 66 74 65 72 20 2f |occurred| after /|
|00000740| 2f 2d 73 74 79 6c 65 20 | 63 6f 6d 6d 65 6e 74 20 |/-style |comment |
|00000750| 77 68 65 6e 20 0d 09 09 | 09 61 73 73 69 67 6e 45 |when ...|.assignE|
|00000760| 63 68 6f 43 6f 6d 6d 65 | 6e 74 20 77 61 73 20 72 |choComme|nt was r|
|00000770| 65 71 75 65 73 74 65 64 | 2e 0d 33 2f 34 2f 39 33 |equested|..3/4/93|
|00000780| 09 64 67 70 09 63 68 61 | 6e 67 65 64 20 74 68 65 |.dgp.cha|nged the|
|00000790| 20 64 65 66 69 6e 69 74 | 69 6f 6e 20 6f 66 20 65 | definit|ion of e|
|000007a0| 6d 70 74 79 53 74 72 69 | 6e 67 20 73 6c 69 67 68 |mptyStri|ng sligh|
|000007b0| 74 6c 79 20 73 6f 20 74 | 68 61 74 20 74 68 69 73 |tly so t|hat this|
|000007c0| 20 66 69 6c 65 20 63 6f | 75 6c 64 20 62 65 0d 09 | file co|uld be..|
|000007d0| 09 09 63 6f 6d 70 69 6c | 65 64 20 61 73 20 61 20 |..compil|ed as a |
|000007e0| 63 6f 64 65 20 72 65 73 | 6f 75 72 63 65 2e 0d 35 |code res|ource..5|
|000007f0| 2f 32 34 2f 39 33 09 64 | 67 70 09 41 73 73 69 67 |/24/93.d|gp.Assig|
|00000800| 6e 6d 65 6e 74 20 6c 69 | 6e 65 73 20 6d 61 79 20 |nment li|nes may |
|00000810| 6e 6f 77 20 62 65 20 63 | 6f 6e 74 69 6e 75 65 64 |now be c|ontinued|
|00000820| 20 62 79 20 70 75 74 74 | 69 6e 67 20 61 20 62 61 | by putt|ing a ba|
|00000830| 63 6b 73 6c 61 73 68 20 | 61 74 20 74 68 65 20 65 |ckslash |at the e|
|00000840| 6e 64 20 6f 66 0d 09 09 | 09 74 68 65 20 6c 69 6e |nd of...|.the lin|
|00000850| 65 2e 0d 09 09 09 53 74 | 72 69 6e 67 73 20 6d 61 |e.....St|rings ma|
|00000860| 79 20 69 6e 63 6c 75 64 | 65 20 6c 69 74 65 72 61 |y includ|e litera|
|00000870| 6c 20 6c 69 6e 65 66 65 | 65 64 73 2c 20 72 61 74 |l linefe|eds, rat|
|00000880| 68 65 72 20 74 68 61 6e | 20 6a 75 73 74 20 22 5c |her than| just "\|
|00000890| 6e 22 2e 0d 09 09 09 50 | 72 69 6e 74 65 64 20 73 |n".....P|rinted s|
|000008a0| 74 72 69 6e 67 20 61 73 | 73 69 67 6e 6d 65 6e 74 |tring as|signment|
|000008b0| 73 20 74 72 61 6e 73 6c | 61 74 65 20 6c 69 6e 65 |s transl|ate line|
|000008c0| 66 65 65 64 73 20 74 6f | 20 22 5c 6e 22 2e 0d 09 |feeds to| "\n"...|
|000008d0| 09 09 53 6b 69 70 20 75 | 6e 6b 6e 6f 77 6e 20 76 |..Skip u|nknown v|
|000008e0| 61 72 69 61 62 6c 65 73 | 20 75 6e 6c 65 73 73 20 |ariables| unless |
|000008f0| 66 6c 61 67 73 26 61 73 | 73 69 67 6e 52 65 70 6f |flags&as|signRepo|
|00000900| 72 74 55 6e 6b 6e 6f 77 | 6e 20 69 73 20 74 72 75 |rtUnknow|n is tru|
|00000910| 65 2e 0d 35 2f 32 37 2f | 39 33 09 64 67 70 09 41 |e..5/27/|93.dgp.A|
|00000920| 64 64 65 64 20 22 64 69 | 6d 22 20 66 69 65 6c 64 |dded "di|m" field|
|00000930| 20 74 6f 20 56 61 72 69 | 61 62 6c 65 20 73 74 72 | to Vari|able str|
|00000940| 75 63 74 75 72 65 2c 20 | 61 6e 64 20 61 64 64 65 |ucture, |and adde|
|00000950| 64 20 73 75 70 70 6f 72 | 74 20 66 6f 72 0d 09 09 |d suppor|t for...|
|00000960| 09 69 74 20 69 6e 20 61 | 6c 6c 20 74 68 65 20 72 |.it in a|ll the r|
|00000970| 6f 75 74 69 6e 65 73 2e | 0d 09 09 09 41 64 64 65 |outines.|....Adde|
|00000980| 64 20 66 6c 6f 61 74 54 | 79 70 65 2e 0d 09 09 09 |d floatT|ype.....|
|00000990| 49 6e 70 75 74 20 6c 69 | 6e 65 20 6c 65 6e 67 74 |Input li|ne lengt|
|000009a0| 68 20 69 73 20 73 74 69 | 6c 6c 20 6c 69 6d 69 74 |h is sti|ll limit|
|000009b0| 65 64 20 74 6f 20 42 55 | 46 46 45 52 5f 53 49 5a |ed to BU|FFER_SIZ|
|000009c0| 45 20 28 70 72 65 73 65 | 6e 74 6c 79 20 35 31 32 |E (prese|ntly 512|
|000009d0| 29 20 62 75 74 0d 09 09 | 09 73 74 72 69 6e 67 73 |) but...|.strings|
|000009e0| 20 28 62 72 6f 6b 65 6e | 20 75 70 20 69 6e 74 6f | (broken| up into|
|000009f0| 20 6c 69 6e 65 73 20 6f | 66 20 6c 65 67 61 6c 20 | lines o|f legal |
|00000a00| 6c 65 6e 67 74 68 20 61 | 6e 64 20 61 75 74 6f 6d |length a|nd autom|
|00000a10| 61 74 69 63 61 6c 6c 79 | 20 0d 09 09 09 63 6f 6e |atically| ....con|
|00000a20| 63 61 74 65 6e 61 74 65 | 64 20 64 75 72 69 6e 67 |catenate|d during|
|00000a30| 20 72 65 61 64 69 6e 67 | 29 20 63 61 6e 20 62 65 | reading|) can be|
|00000a40| 20 6f 66 20 61 6e 79 20 | 6c 65 6e 67 74 68 20 74 | of any |length t|
|00000a50| 68 61 74 20 77 69 6c 6c | 20 66 69 74 0d 09 09 09 |hat will| fit....|
|00000a60| 69 6e 20 6d 65 6d 6f 72 | 79 2e 0d 35 2f 32 38 2f |in memor|y..5/28/|
|00000a70| 39 33 09 64 67 70 09 41 | 64 64 65 64 20 73 75 70 |93.dgp.A|dded sup|
|00000a80| 70 6f 72 74 20 66 6f 72 | 20 68 65 78 2d 65 6e 63 |port for| hex-enc|
|00000a90| 6f 64 65 64 20 73 74 72 | 69 6e 67 73 2e 0d 09 09 |oded str|ings....|
|00000aa0| 09 43 72 65 61 74 65 64 | 20 6e 65 77 20 62 6f 74 |.Created| new bot|
|00000ab0| 74 6c 65 6e 65 63 6b 20 | 70 72 6f 63 65 64 75 72 |tleneck |procedur|
|00000ac0| 65 20 52 65 61 64 4c 69 | 6e 65 20 74 68 61 74 20 |e ReadLi|ne that |
|00000ad0| 64 6f 65 73 20 61 6c 6c | 20 74 68 65 20 72 65 61 |does all| the rea|
|00000ae0| 64 69 6e 67 2e 0d 35 2f | 33 31 2f 39 33 09 64 67 |ding..5/|31/93.dg|
|00000af0| 70 09 61 73 73 69 67 6e | 45 63 68 6f 41 73 73 69 |p.assign|EchoAssi|
|00000b00| 67 6e 6d 65 6e 74 73 20 | 6e 6f 77 20 63 61 6c 6c |gnments |now call|
|00000b10| 73 20 50 72 69 6e 74 41 | 6e 41 73 73 69 67 6e 6d |s PrintA|nAssignm|
|00000b20| 65 6e 74 2e 20 52 65 6d | 6f 76 65 64 20 22 5c 6e |ent. Rem|oved "\n|
|00000b30| 22 20 66 72 6f 6d 0d 09 | 09 09 50 72 69 6e 74 41 |" from..|..PrintA|
|00000b40| 6e 41 73 73 69 67 6e 6d | 65 6e 74 2e 20 4d 61 64 |nAssignm|ent. Mad|
|00000b50| 65 20 61 6c 6c 20 50 72 | 69 6e 74 20 72 6f 75 74 |e all Pr|int rout|
|00000b60| 69 6e 65 73 20 72 65 74 | 75 72 6e 20 61 73 73 69 |ines ret|urn assi|
|00000b70| 67 6e 6d 65 6e 74 20 63 | 6f 75 6e 74 2c 0d 09 09 |gnment c|ount,...|
|00000b80| 09 77 68 69 63 68 20 69 | 73 20 6e 6f 77 20 72 65 |.which i|s now re|
|00000b90| 64 65 66 69 6e 65 64 20 | 61 73 20 74 68 65 20 6e |defined |as the n|
|00000ba0| 75 6d 62 65 72 20 6f 66 | 20 61 72 72 61 79 20 65 |umber of| array e|
|00000bb0| 6c 65 6d 65 6e 74 73 20 | 6f 72 20 73 63 61 6c 61 |lements |or scala|
|00000bc0| 72 73 0d 09 09 09 74 68 | 61 74 20 77 65 72 65 20 |rs....th|at were |
|00000bd0| 61 73 73 69 67 6e 65 64 | 20 6f 72 20 70 72 69 6e |assigned| or prin|
|00000be0| 74 65 64 2e 20 4e 6f 77 | 20 70 61 72 73 65 20 6e |ted. Now| parse n|
|00000bf0| 61 6d 65 73 20 73 6f 20 | 74 68 61 74 0d 09 09 09 |ames so |that....|
|00000c00| 6b 6e 6f 77 6e 20 61 6e | 64 20 75 6e 6b 6e 6f 77 |known an|d unknow|
|00000c10| 6e 20 69 64 65 6e 74 69 | 66 69 65 72 73 20 61 72 |n identi|fiers ar|
|00000c20| 65 20 74 72 65 61 74 65 | 64 20 75 6e 69 66 6f 72 |e treate|d unifor|
|00000c30| 6d 6c 79 3b 20 74 68 65 | 73 65 20 6e 65 77 0d 09 |mly; the|se new..|
|00000c40| 09 09 6e 61 6d 69 6e 67 | 20 72 75 6c 65 73 20 61 |..naming| rules a|
|00000c50| 6c 6c 6f 77 20 6f 6e 6c | 79 20 73 69 6d 70 6c 65 |llow onl|y simple|
|00000c60| 20 43 20 69 64 65 6e 74 | 69 66 69 65 72 73 20 6a | C ident|ifiers j|
|00000c70| 6f 69 6e 65 64 20 62 79 | 20 22 2e 22 20 61 6e 64 |oined by| "." and|
|00000c80| 20 22 2d 3e 22 2e 0d 36 | 2f 31 2f 39 33 09 64 67 | "->"..6|/1/93.dg|
|00000c90| 70 09 69 6e 74 72 6f 64 | 75 63 65 64 20 61 73 73 |p.introd|uced ass|
|00000ca0| 69 67 6e 4e 6f 50 72 69 | 6e 74 66 45 78 69 74 20 |ignNoPri|ntfExit |
|00000cb0| 66 6c 61 67 20 74 68 61 | 74 20 63 61 75 73 65 73 |flag tha|t causes|
|00000cc0| 20 61 6c 6c 20 72 6f 75 | 74 69 6e 65 73 20 74 6f | all rou|tines to|
|00000cd0| 20 68 61 6e 64 6c 65 0d | 09 09 09 65 72 72 6f 72 | handle.|...error|
|00000ce0| 73 20 64 69 73 63 72 65 | 65 74 65 6c 79 2c 20 73 |s discre|etely, s|
|00000cf0| 69 6d 70 6c 79 20 72 65 | 74 75 72 6e 69 6e 67 20 |imply re|turning |
|00000d00| 61 6e 20 65 72 72 6f 72 | 20 6e 75 6d 62 65 72 20 |an error| number |
|00000d10| 74 6f 20 74 68 65 20 63 | 61 6c 6c 65 72 2e 0d 36 |to the c|aller..6|
|00000d20| 2f 32 2f 39 33 09 64 67 | 70 20 50 72 69 6e 74 41 |/2/93.dg|p PrintA|
|00000d30| 6e 41 73 73 69 67 6e 6d | 65 6e 74 20 6e 6f 77 20 |nAssignm|ent now |
|00000d40| 70 72 69 6e 74 73 20 6d | 75 6c 74 69 70 6c 65 20 |prints m|ultiple |
|00000d50| 61 73 73 69 67 6e 6d 65 | 6e 74 73 20 70 65 72 20 |assignme|nts per |
|00000d60| 38 30 20 63 68 61 72 61 | 63 74 65 72 20 6c 69 6e |80 chara|cter lin|
|00000d70| 65 2c 20 0d 09 09 09 61 | 64 64 69 6e 67 20 61 73 |e, ....a|dding as|
|00000d80| 20 6d 61 6e 79 20 63 6f | 6e 74 69 6e 75 61 74 69 | many co|ntinuati|
|00000d90| 6f 6e 20 6c 69 6e 65 73 | 20 61 73 20 6e 65 63 65 |on lines| as nece|
|00000da0| 73 73 61 72 79 2e 20 51 | 75 6f 74 65 64 20 73 74 |ssary. Q|uoted st|
|00000db0| 72 69 6e 67 73 20 28 61 | 6e 64 20 68 65 78 0d 09 |rings (a|nd hex..|
|00000dc0| 09 09 64 61 74 61 20 73 | 74 72 69 6e 67 73 29 20 |..data s|trings) |
|00000dd0| 61 72 65 20 6e 6f 77 20 | 62 72 6f 6b 65 6e 20 75 |are now |broken u|
|00000de0| 70 20 69 6e 74 6f 20 38 | 30 2d 63 68 61 72 61 63 |p into 8|0-charac|
|00000df0| 74 65 72 20 6c 69 6e 65 | 73 3b 20 63 6f 6e 74 69 |ter line|s; conti|
|00000e00| 6e 75 61 74 69 6f 6e 0d | 09 09 09 6c 69 6e 65 73 |nuation.|...lines|
|00000e10| 20 61 72 65 20 69 6e 64 | 65 6e 74 65 64 20 66 6f | are ind|ented fo|
|00000e20| 75 72 20 73 70 61 63 65 | 73 2e 20 41 64 64 65 64 |ur space|s. Added|
|00000e30| 20 63 6f 6d 6d 65 6e 74 | 20 66 69 65 6c 64 20 74 | comment| field t|
|00000e40| 6f 20 56 61 72 69 61 62 | 6c 65 20 73 74 72 75 63 |o Variab|le struc|
|00000e50| 74 75 72 65 0d 09 09 09 | 61 6e 64 20 61 64 64 65 |ture....|and adde|
|00000e60| 64 20 73 75 70 70 6f 72 | 74 20 66 6f 72 20 69 74 |d suppor|t for it|
|00000e70| 20 69 6e 20 50 72 69 6e | 74 41 6e 41 73 73 69 67 | in Prin|tAnAssig|
|00000e80| 6e 6d 65 6e 74 2e 20 52 | 65 6e 61 6d 65 64 20 61 |nment. R|enamed a|
|00000e90| 6c 6c 20 70 75 62 6c 69 | 73 68 65 64 0d 09 09 09 |ll publi|shed....|
|00000ea0| 65 6e 75 6d 20 76 61 6c | 75 65 73 20 74 6f 20 62 |enum val|ues to b|
|00000eb0| 65 67 69 6e 20 77 69 74 | 68 20 22 61 73 73 69 67 |egin wit|h "assig|
|00000ec0| 6e 22 2e 20 52 65 6e 61 | 6d 65 64 20 74 68 69 73 |n". Rena|med this|
|00000ed0| 20 66 69 6c 65 20 22 41 | 73 73 69 67 6e 2e 63 22 | file "A|ssign.c"|
|00000ee0| 2e 20 41 64 64 65 64 0d | 09 09 09 55 6e 65 71 75 |. Added.|...Unequ|
|00000ef0| 61 6c 56 61 72 69 61 62 | 6c 65 73 28 29 2e 20 43 |alVariab|les(). C|
|00000f00| 68 65 63 6b 41 56 61 72 | 69 61 62 6c 65 20 63 68 |heckAVar|iable ch|
|00000f10| 65 63 6b 73 20 74 68 61 | 74 20 76 61 72 69 61 62 |ecks tha|t variab|
|00000f20| 6c 65 20 6e 61 6d 65 20 | 69 73 20 6c 65 67 61 6c |le name |is legal|
|00000f30| 2e 0d 36 2f 35 2f 39 33 | 09 64 67 70 09 52 65 6d |..6/5/93|.dgp.Rem|
|00000f40| 6f 76 65 64 20 61 6c 6c | 20 4d 61 63 69 6e 74 6f |oved all| Macinto|
|00000f50| 73 68 20 64 65 70 65 6e | 64 65 6e 63 69 65 73 2c |sh depen|dencies,|
|00000f60| 20 6c 65 61 76 69 6e 67 | 20 70 75 72 65 20 53 74 | leaving| pure St|
|00000f70| 61 6e 64 61 72 64 20 43 | 20 70 6c 75 73 20 61 20 |andard C| plus a |
|00000f80| 66 65 77 0d 09 09 09 43 | 2b 2b 20 73 74 79 6c 65 |few....C|++ style|
|00000f90| 20 63 6f 6d 6d 65 6e 74 | 73 2e 0d 36 2f 31 36 2f | comment|s..6/16/|
|00000fa0| 39 33 09 64 67 70 09 52 | 65 6d 6f 76 65 64 20 70 |93.dgp.R|emoved p|
|00000fb0| 72 6f 68 69 62 69 74 69 | 6f 6e 3a 20 61 72 72 61 |rohibiti|on: arra|
|00000fc0| 79 73 20 6f 66 20 73 74 | 72 69 6e 67 54 79 70 65 |ys of st|ringType|
|00000fd0| 20 61 72 65 20 6e 6f 77 | 20 6f 6b 2e 0d 09 09 09 | are now| ok.....|
|00000fe0| 49 6e 69 74 69 61 6c 69 | 7a 65 41 56 61 72 69 61 |Initiali|zeAVaria|
|00000ff0| 62 6c 65 20 6e 6f 77 20 | 63 61 6c 6c 73 20 43 68 |ble now |calls Ch|
|00001000| 65 63 6b 41 56 61 72 69 | 61 62 6c 65 20 77 69 74 |eckAVari|able wit|
|00001010| 68 20 22 66 6c 61 67 73 | 22 20 75 6e 6d 6f 64 69 |h "flags|" unmodi|
|00001020| 66 69 65 64 2e 0d 09 09 | 09 43 68 65 63 6b 41 56 |fied....|.CheckAV|
|00001030| 61 72 69 61 62 6c 65 20 | 6e 6f 77 20 63 68 65 63 |ariable |now chec|
|00001040| 6b 73 20 66 6f 72 20 61 | 6e 79 20 69 6c 6c 65 67 |ks for a|ny illeg|
|00001050| 61 6c 20 73 75 66 66 69 | 78 20 69 6e 20 6e 61 6d |al suffi|x in nam|
|00001060| 65 2e 0d 09 09 09 55 6e | 6b 6e 6f 77 6e 20 73 75 |e.....Un|known su|
|00001070| 62 73 63 72 69 70 74 65 | 64 20 76 61 72 69 61 62 |bscripte|d variab|
|00001080| 6c 65 73 20 61 72 65 20 | 6e 6f 77 20 63 6f 72 72 |les are |now corr|
|00001090| 65 63 74 6c 79 20 72 65 | 70 6f 72 74 65 64 20 61 |ectly re|ported a|
|000010a0| 73 20 22 55 4e 4b 4e 4f | 57 4e 22 20 0d 09 09 09 |s "UNKNO|WN" ....|
|000010b0| 72 61 74 68 65 72 20 74 | 68 61 6e 20 22 4f 55 54 |rather t|han "OUT|
|000010c0| 20 4f 46 20 42 4f 55 4e | 44 53 22 2e 0d 36 2f 32 | OF BOUN|DS"..6/2|
|000010d0| 39 2f 39 33 09 64 67 70 | 09 61 64 64 65 64 20 73 |9/93.dgp|.added s|
|000010e0| 68 6f 72 74 44 6f 75 62 | 6c 65 54 79 70 65 2e 0d |hortDoub|leType..|
|000010f0| 37 2f 31 30 2f 39 33 09 | 64 67 70 09 72 65 73 74 |7/10/93.|dgp.rest|
|00001100| 6f 72 65 64 20 53 74 61 | 6e 64 61 72 64 20 43 20 |ored Sta|ndard C |
|00001110| 63 6f 6d 70 61 74 69 62 | 69 6c 69 74 79 20 62 79 |compatib|ility by|
|00001120| 20 75 73 69 6e 67 20 22 | 73 68 6f 72 74 20 64 6f | using "|short do|
|00001130| 75 62 6c 65 22 20 6f 6e | 6c 79 20 69 66 0d 09 09 |uble" on|ly if...|
|00001140| 09 53 48 4f 52 54 5f 44 | 4f 55 42 4c 45 5f 4f 4b |.SHORT_D|OUBLE_OK|
|00001150| 2c 20 73 69 6e 63 65 20 | 53 74 61 6e 64 61 72 64 |, since |Standard|
|00001160| 20 43 20 64 6f 65 73 6e | 27 74 20 61 6c 6c 6f 77 | C doesn|'t allow|
|00001170| 20 74 68 61 74 20 74 79 | 70 65 2e 0d 37 2f 31 39 | that ty|pe..7/19|
|00001180| 2f 39 33 09 64 67 70 09 | 6e 6f 74 65 64 20 74 68 |/93.dgp.|noted th|
|00001190| 61 74 20 61 73 73 69 67 | 6e 20 66 69 6c 65 20 73 |at assig|n file s|
|000011a0| 68 6f 75 6c 64 20 62 65 | 20 6f 70 65 6e 65 64 20 |hould be| opened |
|000011b0| 69 6e 20 74 65 78 74 20 | 6d 6f 64 65 2c 20 6e 6f |in text |mode, no|
|000011c0| 74 20 62 69 6e 61 72 79 | 20 6d 6f 64 65 2c 20 73 |t binary| mode, s|
|000011d0| 6f 20 74 68 61 74 0d 09 | 09 09 5c 72 20 63 68 61 |o that..|..\r cha|
|000011e0| 72 61 63 74 65 72 73 20 | 77 69 6c 6c 20 62 65 20 |racters |will be |
|000011f0| 74 72 61 6e 73 6c 61 74 | 65 64 20 70 72 6f 70 65 |translat|ed prope|
|00001200| 72 6c 79 2e 0d 37 2f 32 | 39 2f 39 33 09 64 68 62 |rly..7/2|9/93.dhb|
|00001210| 20 26 20 64 67 70 20 46 | 6f 75 6e 64 20 61 6e 64 | & dgp F|ound and|
|00001220| 20 66 69 78 65 64 20 74 | 68 65 20 6e 65 77 6c 69 | fixed t|he newli|
|00001230| 6e 65 20 70 72 6f 62 6c | 65 6d 20 74 68 61 74 20 |ne probl|em that |
|00001240| 61 70 70 65 61 72 73 20 | 69 6e 20 74 68 65 20 4d |appears |in the M|
|00001250| 41 54 4c 41 42 0d 09 09 | 09 65 6e 76 69 72 6f 6e |ATLAB...|.environ|
|00001260| 6d 65 6e 74 2c 20 61 73 | 20 64 6f 63 75 6d 65 6e |ment, as| documen|
|00001270| 74 65 64 20 69 6e 20 41 | 73 73 69 67 6e 2e 6e 6f |ted in A|ssign.no|
|00001280| 74 65 2e 0d 37 2f 33 31 | 2f 39 33 09 64 67 70 09 |te..7/31|/93.dgp.|
|00001290| 41 64 64 65 64 20 73 75 | 70 70 6f 72 74 20 66 6f |Added su|pport fo|
|000012a0| 72 20 6d 75 6c 74 69 64 | 69 6d 65 6e 73 69 6f 6e |r multid|imension|
|000012b0| 61 6c 20 61 72 72 61 79 | 73 2c 20 77 69 74 68 20 |al array|s, with |
|000012c0| 75 70 20 74 6f 20 41 53 | 53 49 47 4e 5f 44 49 4d |up to AS|SIGN_DIM|
|000012d0| 53 0d 09 09 09 64 69 6d | 65 6e 73 69 6f 6e 73 2e |S....dim|ensions.|
|000012e0| 20 41 64 64 65 64 20 53 | 65 74 56 61 72 69 61 62 | Added S|etVariab|
|000012f0| 6c 65 41 72 72 61 79 28 | 29 2c 20 63 68 61 6e 67 |leArray(|), chang|
|00001300| 65 64 20 53 65 74 56 61 | 72 69 61 62 6c 65 28 29 |ed SetVa|riable()|
|00001310| 20 61 6e 64 0d 09 09 09 | 53 65 74 56 61 72 69 61 | and....|SetVaria|
|00001320| 62 6c 65 46 69 72 73 74 | 4c 61 73 74 28 29 2c 20 |bleFirst|Last(), |
|00001330| 61 6e 64 20 64 65 6c 65 | 74 65 64 20 53 65 74 41 |and dele|ted SetA|
|00001340| 56 61 72 69 61 62 6c 65 | 46 69 72 73 74 4c 61 73 |Variable|FirstLas|
|00001350| 74 28 29 2e 0d 38 2f 32 | 2f 39 33 09 64 67 70 09 |t()..8/2|/93.dgp.|
|00001360| 41 64 64 65 64 20 64 79 | 6e 61 6d 69 63 20 61 6c |Added dy|namic al|
|00001370| 6c 6f 63 61 74 69 6f 6e | 20 6f 66 20 70 74 72 54 |location| of ptrT|
|00001380| 79 70 65 20 61 72 72 61 | 79 73 2c 20 62 61 73 65 |ype arra|ys, base|
|00001390| 64 20 6f 6e 20 73 63 61 | 6e 6e 69 6e 67 20 74 68 |d on sca|nning th|
|000013a0| 65 20 63 75 72 72 65 6e | 74 0d 09 09 09 67 75 6c |e curren|t....gul|
|000013b0| 70 20 6f 66 20 74 68 65 | 20 61 73 73 69 67 6e 20 |p of the| assign |
|000013c0| 66 69 6c 65 2e 0d 38 2f | 31 32 2f 39 33 09 64 67 |file..8/|12/93.dg|
|000013d0| 70 09 52 65 6e 61 6d 65 | 64 20 22 56 61 72 69 61 |p.Rename|d "Varia|
|000013e0| 62 6c 65 22 20 74 6f 20 | 22 44 65 73 63 72 69 70 |ble" to |"Descrip|
|000013f0| 74 69 6f 6e 22 2e 20 52 | 65 6e 61 6d 65 64 20 6d |tion". R|enamed m|
|00001400| 6f 73 74 20 6f 66 20 74 | 68 65 20 72 6f 75 74 69 |ost of t|he routi|
|00001410| 6e 65 73 2e 20 0d 09 09 | 09 54 68 65 20 68 65 61 |nes. ...|.The hea|
|00001420| 64 65 72 20 66 69 6c 65 | 20 41 73 73 69 67 6e 39 |der file| Assign9|
|00001430| 32 2e 68 20 70 72 6f 76 | 69 64 65 73 20 66 6f 72 |2.h prov|ides for|
|00001440| 20 62 61 63 6b 77 61 72 | 64 20 63 6f 6d 70 61 74 | backwar|d compat|
|00001450| 69 62 69 6c 69 74 79 2e | 0d 38 2f 32 31 2f 39 33 |ibility.|.8/21/93|
|00001460| 09 64 68 62 2c 64 67 70 | 09 46 6f 72 20 63 6f 6d |.dhb,dgp|.For com|
|00001470| 70 61 74 69 62 69 6c 69 | 74 79 20 77 69 74 68 20 |patibili|ty with |
|00001480| 4d 41 54 4c 41 42 20 77 | 65 20 61 76 6f 69 64 20 |MATLAB w|e avoid |
|00001490| 75 73 69 6e 67 20 69 6e | 74 20 61 72 67 75 6d 65 |using in|t argume|
|000014a0| 6e 74 73 20 69 6e 20 73 | 74 64 69 6f 20 0d 09 09 |nts in s|tdio ...|
|000014b0| 09 63 61 6c 6c 73 20 62 | 65 63 61 75 73 65 20 77 |.calls b|ecause w|
|000014c0| 68 65 6e 20 4d 41 54 4c | 41 42 20 69 73 20 74 72 |hen MATL|AB is tr|
|000014d0| 75 65 20 77 65 27 6c 6c | 20 62 65 20 75 73 69 6e |ue we'll| be usin|
|000014e0| 67 20 4d 50 57 27 73 20 | 73 74 64 69 6f 0d 09 09 |g MPW's |stdio...|
|000014f0| 09 6c 69 62 72 61 72 79 | 2c 20 61 6e 64 20 69 74 |.library|, and it|
|00001500| 73 20 69 6e 74 20 69 73 | 20 34 20 62 79 74 65 73 |s int is| 4 bytes|
|00001510| 20 77 68 65 72 65 61 73 | 20 74 68 65 20 54 48 49 | whereas| the THI|
|00001520| 4e 4b 20 43 20 69 6e 74 | 20 69 73 20 32 20 62 79 |NK C int| is 2 by|
|00001530| 74 65 73 2e 0d 09 09 64 | 68 62 2c 6a 6d 73 09 43 |tes....d|hb,jms.C|
|00001540| 68 61 6e 67 65 64 20 22 | 77 61 22 20 69 6e 20 66 |hanged "|wa" in f|
|00001550| 6f 70 65 6e 20 69 6e 20 | 50 72 69 6e 74 41 73 73 |open in |PrintAss|
|00001560| 69 67 6e 6d 65 6e 74 73 | 54 6f 46 69 6c 65 20 74 |ignments|ToFile t|
|00001570| 6f 20 22 61 22 2e 0d 09 | 09 64 68 62 2c 6a 6d 73 |o "a"...|.dhb,jms|
|00001580| 2c 64 67 70 20 4d 6f 76 | 65 64 20 74 68 65 20 4e |,dgp Mov|ed the N|
|00001590| 4c 20 61 6e 64 20 4e 45 | 57 4c 49 4e 45 20 6d 61 |L and NE|WLINE ma|
|000015a0| 63 72 6f 73 20 69 6e 74 | 6f 20 56 69 64 65 6f 54 |cros int|o VideoT|
|000015b0| 6f 6f 6c 62 6f 78 2e 68 | 2e 0d 39 2f 32 2f 39 33 |oolbox.h|..9/2/93|
|000015c0| 09 64 67 70 09 45 78 70 | 61 6e 64 65 64 20 64 6f |.dgp.Exp|anded do|
|000015d0| 63 75 6d 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 46 |cumentat|ion of F|
|000015e0| 72 65 65 50 74 72 56 61 | 72 69 61 62 6c 65 73 2e |reePtrVa|riables.|
|000015f0| 20 46 69 78 65 64 20 6d | 69 6e 6f 72 20 62 75 67 | Fixed m|inor bug|
|00001600| 73 0d 09 09 09 69 6e 20 | 50 72 69 6e 74 41 56 61 |s....in |PrintAVa|
|00001610| 72 69 61 62 6c 65 20 66 | 6f 72 20 68 65 78 20 65 |riable f|or hex e|
|00001620| 6e 63 6f 64 65 64 20 50 | 74 72 20 76 61 72 69 61 |ncoded P|tr varia|
|00001630| 62 6c 65 73 20 73 6f 20 | 74 68 61 74 20 64 69 6d |bles so |that dim|
|00001640| 65 6e 73 69 6f 6e 61 6c | 69 74 79 0d 09 09 09 6f |ensional|ity....o|
|00001650| 66 20 77 68 61 74 20 77 | 61 73 20 77 72 69 74 74 |f what w|as writt|
|00001660| 65 6e 20 69 73 20 72 65 | 63 6f 76 65 72 65 64 20 |en is re|covered |
|00001670| 77 68 65 6e 20 69 74 27 | 73 20 72 65 61 64 2e 0d |when it'|s read..|
|00001680| 39 2f 37 2f 39 33 09 64 | 67 70 09 49 6e 74 72 6f |9/7/93.d|gp.Intro|
|00001690| 64 75 63 65 64 20 53 54 | 44 49 4f 5f 49 4e 54 2e |duced ST|DIO_INT.|
|000016a0| 0d 39 2f 37 2f 39 33 09 | 64 68 62 2c 6a 6d 73 2c |.9/7/93.|dhb,jms,|
|000016b0| 64 67 70 09 41 64 64 65 | 64 20 4f 70 65 6e 43 61 |dgp.Adde|d OpenCa|
|000016c0| 6c 46 69 6c 65 57 72 69 | 74 65 2c 20 4f 70 65 6e |lFileWri|te, Open|
|000016d0| 43 61 6c 46 69 6c 65 52 | 65 61 64 2c 20 4f 70 65 |CalFileR|ead, Ope|
|000016e0| 6e 43 61 6c 46 69 6c 65 | 52 65 61 64 41 6e 64 43 |nCalFile|ReadAndC|
|000016f0| 68 65 63 6b 2c 0d 09 09 | 09 41 70 70 65 6e 64 44 |heck,...|.AppendD|
|00001700| 65 73 63 72 69 70 74 69 | 6f 6e 73 2c 20 43 6f 70 |escripti|ons, Cop|
|00001710| 79 44 65 73 63 72 69 70 | 74 69 6f 6e 73 2c 20 41 |yDescrip|tions, A|
|00001720| 6c 6c 6f 63 61 74 65 44 | 65 73 63 72 69 70 74 69 |llocateD|escripti|
|00001730| 6f 6e 73 2c 0d 09 09 09 | 46 72 65 65 44 65 73 63 |ons,....|FreeDesc|
|00001740| 72 69 70 74 69 6f 6e 73 | 2c 20 4e 75 6d 62 65 72 |riptions|, Number|
|00001750| 4f 66 44 65 73 63 72 69 | 70 74 69 6f 6e 73 2c 20 |OfDescri|ptions, |
|00001760| 4e 75 6c 6c 44 65 73 63 | 72 69 70 74 69 6f 6e 2c |NullDesc|ription,|
|00001770| 20 61 6e 64 20 0d 09 09 | 09 49 73 4e 75 6c 6c 44 | and ...|.IsNullD|
|00001780| 65 73 63 72 69 70 74 69 | 6f 6e 2e 0d 39 2f 39 2f |escripti|on..9/9/|
|00001790| 39 33 09 64 68 62 09 41 | 64 64 65 64 20 52 65 61 |93.dhb.A|dded Rea|
|000017a0| 64 41 73 73 69 67 6e 6d | 65 6e 74 53 74 72 65 61 |dAssignm|entStrea|
|000017b0| 6d 2c 20 74 6f 20 72 65 | 61 64 20 74 68 65 20 72 |m, to re|ad the r|
|000017c0| 65 73 74 20 6f 66 20 61 | 20 66 69 6c 65 20 73 74 |est of a| file st|
|000017d0| 72 65 61 6d 20 61 73 20 | 61 20 73 69 6e 67 6c 65 |ream as |a single|
|000017e0| 0d 09 09 09 67 75 6c 70 | 2e 0d 39 2f 31 31 2f 39 |....gulp|..9/11/9|
|000017f0| 33 09 64 67 70 09 72 65 | 77 72 6f 74 65 20 52 65 |3.dgp.re|wrote Re|
|00001800| 61 64 41 73 73 69 67 6e | 6d 65 6e 74 46 69 6c 65 |adAssign|mentFile|
|00001810| 20 74 6f 20 6a 75 73 74 | 20 6f 70 65 6e 20 74 68 | to just| open th|
|00001820| 65 20 66 69 6c 65 20 61 | 6e 64 20 63 61 6c 6c 20 |e file a|nd call |
|00001830| 0d 09 09 09 52 65 61 64 | 41 73 73 69 67 6e 6d 65 |....Read|Assignme|
|00001840| 6e 74 53 74 72 65 61 6d | 2e 0d 39 2f 31 32 2f 39 |ntStream|..9/12/9|
|00001850| 33 09 64 68 62 09 43 68 | 61 6e 67 65 64 20 53 54 |3.dhb.Ch|anged ST|
|00001860| 44 49 4f 5f 49 4e 54 20 | 74 6f 20 50 52 49 4e 54 |DIO_INT |to PRINT|
|00001870| 46 5f 49 4e 54 2c 20 61 | 64 64 65 64 20 69 6e 63 |F_INT, a|dded inc|
|00001880| 6c 75 73 69 6f 6e 20 6f | 66 20 56 69 64 65 6f 54 |lusion o|f VideoT|
|00001890| 6f 6f 6c 62 6f 78 0d 20 | 20 20 20 20 20 20 20 20 |oolbox. | |
|000018a0| 20 20 20 77 68 65 6e 20 | 4d 41 54 4c 41 42 20 69 | when |MATLAB i|
|000018b0| 73 20 6f 6e 2e 0d 39 2f | 31 35 2f 39 33 09 64 67 |s on..9/|15/93.dg|
|000018c0| 70 09 4d 6f 76 65 64 20 | 64 6f 63 75 6d 65 6e 74 |p.Moved |document|
|000018d0| 61 74 69 6f 6e 20 74 6f | 20 41 73 73 69 67 6e 2e |ation to| Assign.|
|000018e0| 6e 6f 74 65 2e 0d 39 2f | 31 36 2f 39 33 09 64 67 |note..9/|16/93.dg|
|000018f0| 70 09 4d 65 72 67 65 64 | 20 41 73 73 69 67 6e 2e |p.Merged| Assign.|
|00001900| 68 20 69 6e 74 6f 20 56 | 69 64 65 6f 54 6f 6f 6c |h into V|ideoTool|
|00001910| 62 6f 78 2e 68 2e 0d 33 | 2f 34 2f 39 34 09 64 67 |box.h..3|/4/94.dg|
|00001920| 70 09 49 6e 63 72 65 61 | 73 65 64 20 6e 75 6d 62 |p.Increa|sed numb|
|00001930| 65 72 20 6f 66 20 66 6c | 6f 61 74 20 61 6e 64 20 |er of fl|oat and |
|00001940| 64 6f 75 62 6c 65 20 64 | 69 67 69 74 73 20 70 72 |double d|igits pr|
|00001950| 6f 64 75 63 65 64 20 62 | 79 20 50 72 69 6e 74 41 |oduced b|y PrintA|
|00001960| 6e 41 73 73 69 67 6e 6d | 65 6e 74 20 0d 09 09 09 |nAssignm|ent ....|
|00001970| 75 70 20 74 6f 20 74 68 | 61 74 20 73 70 65 63 69 |up to th|at speci|
|00001980| 66 69 65 64 20 69 6e 20 | 66 6c 6f 61 74 2e 68 2e |fied in |float.h.|
|00001990| 20 54 68 69 73 20 73 68 | 6f 75 6c 64 20 65 6c 69 | This sh|ould eli|
|000019a0| 6d 69 6e 61 74 65 20 73 | 70 75 72 69 6f 75 73 20 |minate s|purious |
|000019b0| 66 61 69 6c 75 72 65 0d | 09 09 09 6f 66 20 74 68 |failure.|...of th|
|000019c0| 65 20 72 65 61 64 2d 62 | 61 63 6b 20 63 68 65 63 |e read-b|ack chec|
|000019d0| 6b 73 2e 0d 09 09 09 45 | 6e 68 61 6e 63 65 64 20 |ks.....E|nhanced |
|000019e0| 50 72 69 6e 74 51 75 6f | 74 65 64 53 74 72 69 6e |PrintQuo|tedStrin|
|000019f0| 67 20 74 6f 20 63 6f 72 | 72 65 63 74 6c 79 20 68 |g to cor|rectly h|
|00001a00| 61 6e 64 6c 65 20 73 74 | 72 69 6e 67 73 20 63 6f |andle st|rings co|
|00001a10| 6e 74 61 69 6e 69 6e 67 | 20 74 68 65 20 64 6f 75 |ntaining| the dou|
|00001a20| 62 6c 65 0d 09 09 09 71 | 75 6f 74 65 20 63 68 61 |ble....q|uote cha|
|00001a30| 72 61 63 74 65 72 2e 0d | 33 2f 32 38 2f 39 34 09 |racter..|3/28/94.|
|00001a40| 64 67 70 20 49 6e 73 65 | 72 74 65 64 20 73 70 61 |dgp Inse|rted spa|
|00001a50| 63 65 20 62 65 66 6f 72 | 65 20 63 6f 6d 6d 65 6e |ce befor|e commen|
|00001a60| 74 73 20 28 69 2e 65 2e | 20 62 65 66 6f 72 65 20 |ts (i.e.| before |
|00001a70| 22 2f 2a 22 29 20 61 6e | 64 20 6e 6f 77 20 70 61 |"/*") an|d now pa|
|00001a80| 64 20 74 68 65 20 69 6e | 73 69 64 65 0d 09 09 09 |d the in|side....|
|00001a90| 6f 66 20 74 68 65 20 63 | 6f 6d 6d 65 6e 74 20 64 |of the c|omment d|
|00001aa0| 65 6c 69 6d 69 74 65 72 | 73 20 77 69 74 68 20 6f |elimiter|s with o|
|00001ab0| 70 74 69 6f 6e 2d 73 70 | 61 63 65 20 69 6e 73 74 |ption-sp|ace inst|
|00001ac0| 65 61 64 20 6f 66 20 73 | 70 61 63 65 20 66 6f 72 |ead of s|pace for|
|00001ad0| 20 6d 6f 72 65 20 0d 09 | 09 09 70 6c 65 61 73 69 | more ..|..pleasi|
|00001ae0| 6e 67 20 77 6f 72 64 20 | 77 72 61 70 70 69 6e 67 |ng word |wrapping|
|00001af0| 20 77 68 65 6e 20 74 68 | 65 20 61 73 73 69 67 6e | when th|e assign|
|00001b00| 6d 65 6e 74 20 66 69 6c | 65 20 69 73 20 76 69 65 |ment fil|e is vie|
|00001b10| 77 65 64 20 69 6e 20 74 | 68 61 74 20 77 61 79 2e |wed in t|hat way.|
|00001b20| 0d 36 2f 31 36 2f 39 34 | 09 64 67 70 09 45 6e 68 |.6/16/94|.dgp.Enh|
|00001b30| 61 6e 63 65 64 20 50 61 | 72 73 69 6e 67 45 72 72 |anced Pa|rsingErr|
|00001b40| 6f 72 20 74 6f 20 75 73 | 65 20 50 72 69 6e 74 51 |or to us|e PrintQ|
|00001b50| 75 6f 74 65 64 53 74 72 | 69 6e 67 20 74 6f 20 70 |uotedStr|ing to p|
|00001b60| 72 69 6e 74 20 74 68 65 | 20 6f 66 66 65 6e 64 69 |rint the| offendi|
|00001b70| 6e 67 20 74 65 78 74 0d | 09 09 09 73 6f 20 74 68 |ng text.|...so th|
|00001b80| 61 74 20 61 6e 79 20 73 | 70 75 72 69 6f 75 73 20 |at any s|purious |
|00001b90| 6e 6f 6e 70 72 69 6e 74 | 69 6e 67 20 63 68 61 72 |nonprint|ing char|
|00001ba0| 61 63 74 65 72 73 20 77 | 69 6c 6c 20 62 65 20 72 |acters w|ill be r|
|00001bb0| 65 76 65 61 6c 65 64 2e | 0d 09 09 09 50 61 72 73 |evealed.|....Pars|
|00001bc0| 69 6e 67 45 72 72 6f 72 | 20 6e 6f 77 20 73 75 70 |ingError| now sup|
|00001bd0| 70 72 65 73 73 65 73 20 | 22 5c 6e 22 20 61 74 20 |presses |"\n" at |
|00001be0| 65 6e 64 20 6f 66 20 6f | 66 66 65 6e 64 69 6e 67 |end of o|ffending|
|00001bf0| 20 73 74 72 69 6e 67 2e | 0d 09 09 09 45 6e 68 61 | string.|....Enha|
|00001c00| 6e 63 65 64 20 50 72 69 | 6e 74 51 75 6f 74 65 64 |nced Pri|ntQuoted|
|00001c10| 53 74 72 69 6e 67 20 74 | 6f 20 61 63 63 65 70 74 |String t|o accept|
|00001c20| 20 61 72 62 69 74 72 61 | 72 79 20 6f 70 65 6e 20 | arbitra|ry open |
|00001c30| 61 6e 64 20 63 6c 6f 73 | 65 20 73 74 72 69 6e 67 |and clos|e string|
|00001c40| 73 2c 20 0d 09 09 09 74 | 79 70 69 63 61 6c 6c 79 |s, ....t|ypically|
|00001c50| 20 6a 75 73 74 20 74 68 | 65 20 74 72 61 64 69 74 | just th|e tradit|
|00001c60| 69 6f 6e 61 6c 20 64 6f | 75 62 6c 65 2d 71 75 6f |ional do|uble-quo|
|00001c70| 74 65 20 63 68 61 72 61 | 63 74 65 72 2e 0d 36 2f |te chara|cter..6/|
|00001c80| 31 37 2f 39 34 09 64 67 | 70 09 4d 6f 64 69 66 69 |17/94.dg|p.Modifi|
|00001c90| 65 64 20 50 72 69 6e 74 | 51 75 6f 74 65 64 53 74 |ed Print|QuotedSt|
|00001ca0| 72 69 6e 67 20 74 6f 20 | 70 72 69 6e 74 20 6f 70 |ring to |print op|
|00001cb0| 74 69 6f 6e 2d 73 70 61 | 63 65 20 22 5c 33 31 32 |tion-spa|ce "\312|
|00001cc0| 22 20 64 69 72 65 63 74 | 6c 79 2c 20 73 6f 0d 09 |" direct|ly, so..|
|00001cd0| 09 09 74 68 61 74 20 74 | 68 65 20 70 72 69 6e 74 |..that t|he print|
|00001ce0| 6f 75 74 20 77 69 6c 6c | 20 62 65 20 72 65 61 64 |out will| be read|
|00001cf0| 61 62 6c 65 2e 0d 37 2f | 36 2f 39 34 09 64 67 70 |able..7/|6/94.dgp|
|00001d00| 09 52 65 70 6c 61 63 65 | 64 20 6d 61 78 69 6d 75 |.Replace|d maximu|
|00001d10| 6d 20 6c 69 6e 65 6c 65 | 6e 67 74 68 20 6f 66 20 |m linele|ngth of |
|00001d20| 38 30 20 62 79 20 61 20 | 63 6f 6d 70 69 6c 65 2d |80 by a |compile-|
|00001d30| 74 69 6d 65 20 63 6f 6e | 73 74 61 6e 74 20 6f 66 |time con|stant of|
|00001d40| 20 37 36 2c 20 73 6f 0d | 09 09 09 74 68 61 74 20 | 76, so.|...that |
|00001d50| 61 73 73 69 67 6e 6d 65 | 6e 74 20 66 69 6c 65 73 |assignme|nt files|
|00001d60| 20 63 61 6e 20 62 65 20 | 65 6d 61 69 6c 65 64 2e | can be |emailed.|
|00001d70| 0d 37 2f 37 2f 39 34 09 | 64 67 70 09 41 64 64 65 |.7/7/94.|dgp.Adde|
|00001d80| 64 20 43 6f 70 79 44 65 | 73 63 72 69 62 65 64 56 |d CopyDe|scribedV|
|00001d90| 61 72 73 2e 0d 37 2f 31 | 31 2f 39 34 20 64 67 70 |ars..7/1|1/94 dgp|
|00001da0| 20 46 69 78 65 64 20 62 | 75 67 20 69 6e 20 52 65 | Fixed b|ug in Re|
|00001db0| 61 64 41 73 73 69 67 6e | 6d 65 6e 74 53 74 72 65 |adAssign|mentStre|
|00001dc0| 61 6d 20 61 6e 64 20 52 | 65 61 64 41 73 73 69 67 |am and R|eadAssig|
|00001dd0| 6e 6d 65 6e 74 4c 69 6e | 65 20 74 68 61 74 20 67 |nmentLin|e that g|
|00001de0| 61 72 62 6c 65 64 20 74 | 68 65 0d 09 09 09 72 65 |arbled t|he....re|
|00001df0| 74 75 72 6e 65 64 20 65 | 72 72 6f 72 20 76 61 6c |turned e|rror val|
|00001e00| 75 65 2c 20 69 66 20 74 | 68 65 72 65 20 77 61 73 |ue, if t|here was|
|00001e10| 20 61 6e 20 65 72 72 6f | 72 2c 20 62 79 20 61 64 | an erro|r, by ad|
|00001e20| 64 69 6e 67 20 74 6f 20 | 69 74 20 74 68 65 20 6e |ding to |it the n|
|00001e30| 75 6d 62 65 72 20 6f 66 | 0d 09 09 09 6c 69 6e 65 |umber of|....line|
|00001e40| 73 20 72 65 61 64 2e 0d | 37 2f 31 36 2f 39 34 20 |s read..|7/16/94 |
|00001e50| 64 67 70 20 46 6f 75 6e | 64 20 61 6e 64 20 66 69 |dgp Foun|d and fi|
|00001e60| 78 65 64 20 61 20 6d 65 | 6d 6f 72 79 20 6c 65 61 |xed a me|mory lea|
|00001e70| 6b 20 69 6e 20 52 65 61 | 64 41 73 73 69 67 6e 6d |k in Rea|dAssignm|
|00001e80| 65 6e 74 4c 69 6e 65 2e | 20 47 65 74 4e 61 6d 65 |entLine.| GetName|
|00001e90| 28 29 20 63 61 6c 6c 65 | 64 0d 09 09 09 6d 61 6c |() calle|d....mal|
|00001ea0| 6c 6f 63 20 66 6f 72 20 | 64 53 63 72 61 74 63 68 |loc for |dScratch|
|00001eb0| 2d 3e 6e 61 6d 65 2c 20 | 77 68 69 63 68 20 77 61 |->name, |which wa|
|00001ec0| 73 6e 27 74 20 62 65 69 | 6e 67 20 66 72 65 65 64 |sn't bei|ng freed|
|00001ed0| 2e 20 54 68 69 73 20 63 | 6f 73 74 20 61 62 6f 75 |. This c|ost abou|
|00001ee0| 74 0d 09 09 09 34 30 20 | 62 79 74 65 73 20 66 6f |t....40 |bytes fo|
|00001ef0| 72 20 65 76 65 72 79 20 | 76 61 72 69 61 62 6c 65 |r every |variable|
|00001f00| 2e 20 49 20 66 69 78 65 | 64 20 74 68 61 74 2e 20 |. I fixe|d that. |
|00001f10| 54 68 65 72 65 20 73 74 | 69 6c 6c 20 73 65 65 6d |There st|ill seem|
|00001f20| 73 20 74 6f 20 62 65 20 | 61 0d 09 09 09 6d 75 63 |s to be |a....muc|
|00001f30| 68 20 73 6d 61 6c 6c 65 | 72 20 6d 65 6d 6f 72 79 |h smalle|r memory|
|00001f40| 20 6c 65 61 6b 2c 20 77 | 68 69 63 68 20 49 20 63 | leak, w|hich I c|
|00001f50| 6f 75 6c 64 6e 27 74 20 | 71 75 69 63 6b 6c 79 20 |ouldn't |quickly |
|00001f60| 6c 6f 63 61 74 65 2c 20 | 61 6e 64 20 77 68 69 63 |locate, |and whic|
|00001f70| 68 0d 09 09 09 49 20 63 | 61 6e 20 6c 69 76 65 20 |h....I c|an live |
|00001f80| 77 69 74 68 20 66 6f 72 | 20 74 68 65 20 74 69 6d |with for| the tim|
|00001f90| 65 20 62 65 69 6e 67 2e | 0d 39 2f 35 2f 39 34 09 |e being.|.9/5/94.|
|00001fa0| 64 67 70 09 61 64 64 65 | 64 20 73 75 70 70 6f 72 |dgp.adde|d suppor|
|00001fb0| 74 20 66 6f 72 20 72 65 | 61 64 69 6e 67 20 6f 66 |t for re|ading of|
|00001fc0| 20 4d 65 74 72 6f 77 65 | 72 6b 73 20 43 6f 64 65 | Metrowe|rks Code|
|00001fd0| 57 61 72 72 69 6f 72 20 | 43 20 73 74 79 6c 65 20 |Warrior |C style |
|00001fe0| 6f 66 20 70 72 69 6e 74 | 69 6e 67 0d 09 09 09 4e |of print|ing....N|
|00001ff0| 41 4e 73 2c 20 65 2e 67 | 2e 20 4e 41 4e 28 30 32 |ANs, e.g|. NAN(02|
|00002000| 31 29 0d 39 2f 31 30 2f | 39 34 09 64 67 70 09 74 |1).9/10/|94.dgp.t|
|00002010| 68 65 20 76 61 72 69 61 | 62 6c 65 20 22 65 72 72 |he varia|ble "err|
|00002020| 6f 72 22 20 69 73 20 6e | 6f 77 20 61 6c 77 61 79 |or" is n|ow alway|
|00002030| 73 20 64 65 63 6c 61 72 | 65 64 20 69 6e 74 2e 20 |s declar|ed int. |
|00002040| 28 53 6f 20 69 74 27 73 | 20 73 61 66 65 20 74 6f |(So it's| safe to|
|00002050| 20 70 72 69 6e 74 20 77 | 69 74 68 20 25 64 2e 29 | print w|ith %d.)|
|00002060| 0d 37 2f 31 39 2f 39 35 | 20 64 67 70 20 6d 61 64 |.7/19/95| dgp mad|
|00002070| 65 20 63 6f 6d 70 61 74 | 69 62 6c 65 20 77 69 74 |e compat|ible wit|
|00002080| 68 20 53 74 61 6e 64 61 | 72 64 20 43 20 62 79 20 |h Standa|rd C by |
|00002090| 63 68 61 6e 67 69 6e 67 | 20 2f 2f 20 74 6f 20 73 |changing| // to s|
|000020a0| 74 61 6e 64 61 72 64 20 | 43 20 63 6f 6d 6d 65 6e |tandard |C commen|
|000020b0| 74 73 2e 0d 31 31 2f 38 | 2f 39 35 20 64 67 70 20 |ts..11/8|/95 dgp |
|000020c0| 74 72 61 63 6b 65 64 20 | 64 6f 77 6e 20 61 6e 64 |tracked |down and|
|000020d0| 20 66 69 78 65 64 20 62 | 75 67 20 69 6e 20 52 65 | fixed b|ug in Re|
|000020e0| 61 64 41 73 73 69 67 6e | 6d 65 6e 74 4c 69 6e 65 |adAssign|mentLine|
|000020f0| 28 29 2c 20 74 68 65 20 | 44 65 73 63 72 69 70 74 |(), the |Descript|
|00002100| 69 6f 6e 20 77 61 73 20 | 62 65 69 6e 67 20 63 6f |ion was |being co|
|00002110| 72 72 75 70 74 65 64 0d | 62 79 20 66 72 65 65 69 |rrupted.|by freei|
|00002120| 6e 67 20 61 6e 20 75 6e | 61 6c 6c 6f 63 61 74 65 |ng an un|allocate|
|00002130| 64 20 76 61 72 69 61 62 | 6c 65 2e 20 54 68 65 20 |d variab|le. The |
|00002140| 66 69 78 20 69 73 20 6d | 61 72 6b 65 64 20 62 79 |fix is m|arked by|
|00002150| 20 22 31 31 2f 38 2f 39 | 35 22 2e 0d 34 2f 31 39 | "11/8/9|5"..4/19|
|00002160| 2f 39 36 20 64 67 70 20 | 69 66 20 4d 41 54 4c 41 |/96 dgp |if MATLA|
|00002170| 42 20 74 68 65 6e 20 75 | 73 65 20 76 73 70 72 69 |B then u|se vspri|
|00002180| 6e 74 66 20 61 6e 64 20 | 70 72 69 6e 74 66 20 69 |ntf and |printf i|
|00002190| 6e 73 74 65 61 64 20 6f | 66 20 76 66 70 72 69 6e |nstead o|f vfprin|
|000021a0| 74 66 28 73 74 64 6f 75 | 74 2e 2e 2e 29 2c 20 77 |tf(stdou|t...), w|
|000021b0| 68 69 63 68 20 64 6f 65 | 73 6e 27 74 20 77 6f 72 |hich doe|sn't wor|
|000021c0| 6b 2e 0d 43 68 61 6e 67 | 65 64 20 73 74 72 74 6f |k..Chang|ed strto|
|000021d0| 63 28 29 2c 20 72 65 70 | 6c 61 63 69 6e 67 20 4e |c(), rep|lacing N|
|000021e0| 45 57 4c 49 4e 45 20 62 | 79 20 42 4f 54 48 20 27 |EWLINE b|y BOTH '|
|000021f0| 5c 6e 27 20 61 6e 64 20 | 27 5c 72 27 2e 0d 35 2f |\n' and |'\r'..5/|
|00002200| 32 38 2f 39 36 20 64 67 | 70 20 69 6e 63 6c 75 64 |28/96 dg|p includ|
|00002210| 65 20 6d 79 66 70 72 69 | 6e 74 66 20 72 6f 75 74 |e myfpri|ntf rout|
|00002220| 69 6e 65 20 6f 6e 6c 79 | 20 23 69 66 20 4d 41 54 |ine only| #if MAT|
|00002230| 4c 41 42 0d 2a 2f 0d 23 | 69 6e 63 6c 75 64 65 20 |LAB.*/.#|include |
|00002240| 22 56 69 64 65 6f 54 6f | 6f 6c 62 6f 78 2e 68 22 |"VideoTo|olbox.h"|
|00002250| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 61 72 |.#includ|e <stdar|
|00002260| 67 2e 68 3e 0d 23 69 66 | 20 4d 41 54 4c 41 42 0d |g.h>.#if| MATLAB.|
|00002270| 09 23 64 65 66 69 6e 65 | 20 66 70 72 69 6e 74 66 |.#define| fprintf|
|00002280| 20 6d 79 66 70 72 69 6e | 74 66 0d 09 69 6e 74 20 | myfprin|tf..int |
|00002290| 6d 79 66 70 72 69 6e 74 | 66 28 46 49 4c 45 20 2a |myfprint|f(FILE *|
|000022a0| 73 74 72 65 61 6d 2c 63 | 6f 6e 73 74 20 63 68 61 |stream,c|onst cha|
|000022b0| 72 20 2a 66 6f 72 6d 61 | 74 2c 2e 2e 2e 29 3b 0d |r *forma|t,...);.|
|000022c0| 23 65 6e 64 69 66 0d 2f | 2a 0d 23 69 6e 63 6c 75 |#endif./|*.#inclu|
|000022d0| 64 65 20 3c 61 73 73 65 | 72 74 2e 68 3e 09 2f 2f |de <asse|rt.h>.//|
|000022e0| 20 41 6c 72 65 61 64 79 | 20 69 6e 63 6c 75 64 65 | Already| include|
|000022f0| 64 20 62 79 20 56 69 64 | 65 6f 54 6f 6f 6c 62 6f |d by Vid|eoToolbo|
|00002300| 78 2e 68 0d 23 69 6e 63 | 6c 75 64 65 20 3c 63 74 |x.h.#inc|lude <ct|
|00002310| 79 70 65 2e 68 3e 09 2f | 2f 20 41 6c 72 65 61 64 |ype.h>./|/ Alread|
|00002320| 79 20 69 6e 63 6c 75 64 | 65 64 20 62 79 20 56 69 |y includ|ed by Vi|
|00002330| 64 65 6f 54 6f 6f 6c 62 | 6f 78 2e 68 0d 23 69 6e |deoToolb|ox.h.#in|
|00002340| 63 6c 75 64 65 20 3c 73 | 74 64 69 6f 2e 68 3e 09 |clude <s|tdio.h>.|
|00002350| 2f 2f 20 41 6c 72 65 61 | 64 79 20 69 6e 63 6c 75 |// Alrea|dy inclu|
|00002360| 64 65 64 20 62 79 20 56 | 69 64 65 6f 54 6f 6f 6c |ded by V|ideoTool|
|00002370| 62 6f 78 2e 68 0d 23 69 | 6e 63 6c 75 64 65 20 3c |box.h.#i|nclude <|
|00002380| 73 74 64 6c 69 62 2e 68 | 3e 09 2f 2f 20 41 6c 72 |stdlib.h|>.// Alr|
|00002390| 65 61 64 79 20 69 6e 63 | 6c 75 64 65 64 20 62 79 |eady inc|luded by|
|000023a0| 20 56 69 64 65 6f 54 6f | 6f 6c 62 6f 78 2e 68 0d | VideoTo|olbox.h.|
|000023b0| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 72 69 6e 67 |#include| <string|
|000023c0| 2e 68 3e 09 2f 2f 20 41 | 6c 72 65 61 64 79 20 69 |.h>.// A|lready i|
|000023d0| 6e 63 6c 75 64 65 64 20 | 62 79 20 56 69 64 65 6f |ncluded |by Video|
|000023e0| 54 6f 6f 6c 62 6f 78 2e | 68 0d 2a 2f 0d 23 64 65 |Toolbox.|h.*/.#de|
|000023f0| 66 69 6e 65 20 4d 41 58 | 5f 4c 49 4e 45 4c 45 4e |fine MAX|_LINELEN|
|00002400| 47 54 48 20 37 36 0d 2f | 2a 0d 49 73 4e 61 6e 20 |GTH 76./|*.IsNan |
|00002410| 61 6e 64 20 49 73 46 69 | 6e 69 74 65 2d 2d 73 65 |and IsFi|nite--se|
|00002420| 65 20 56 69 64 65 6f 54 | 6f 6f 6c 62 6f 78 2e 68 |e VideoT|oolbox.h|
|00002430| 2d 2d 73 68 6f 75 6c 64 | 20 77 6f 72 6b 20 6f 6e |--should| work on|
|00002440| 20 6d 6f 73 74 20 49 6e | 74 65 6c 20 61 6e 64 20 | most In|tel and |
|00002450| 4d 6f 74 6f 72 6f 6c 61 | 0d 70 72 6f 63 65 73 73 |Motorola|.process|
|00002460| 6f 72 73 2e 20 49 66 20 | 49 73 4e 61 6e 20 61 6e |ors. If |IsNan an|
|00002470| 64 20 49 73 46 69 6e 69 | 74 65 20 64 6f 6e 27 74 |d IsFini|te don't|
|00002480| 20 77 6f 72 6b 20 6f 6e | 20 79 6f 75 72 20 63 6f | work on| your co|
|00002490| 6d 70 75 74 65 72 2c 20 | 64 6f 6e 27 74 20 66 72 |mputer, |don't fr|
|000024a0| 65 74 2e 20 54 68 65 79 | 0d 61 72 65 20 75 73 65 |et. They|.are use|
|000024b0| 64 20 73 6f 6c 65 6c 79 | 20 62 79 20 55 6e 65 71 |d solely| by Uneq|
|000024c0| 75 61 6c 44 65 73 63 72 | 69 62 65 64 56 61 72 50 |ualDescr|ibedVarP|
|000024d0| 61 69 72 2e 20 41 20 71 | 75 69 63 6b 20 66 69 78 |air. A q|uick fix|
|000024e0| 20 69 73 20 74 6f 20 75 | 73 65 20 74 68 65 20 66 | is to u|se the f|
|000024f0| 6f 6c 6c 6f 77 69 6e 67 | 0d 64 65 66 69 6e 69 74 |ollowing|.definit|
|00002500| 69 6f 6e 73 2c 20 74 68 | 65 20 6f 6e 6c 79 20 62 |ions, th|e only b|
|00002510| 61 64 20 65 66 66 65 63 | 74 20 6f 66 20 77 68 69 |ad effec|t of whi|
|00002520| 63 68 20 77 69 6c 6c 20 | 62 65 20 74 68 61 74 20 |ch will |be that |
|00002530| 63 6f 6d 70 61 72 69 73 | 6f 6e 73 20 6f 66 20 4e |comparis|ons of N|
|00002540| 41 4e 73 20 6d 61 79 0d | 61 70 70 65 61 72 20 73 |ANs may.|appear s|
|00002550| 70 75 72 69 6f 75 73 6c | 79 20 75 6e 65 71 75 61 |puriousl|y unequa|
|00002560| 6c 2e 0d 2a 2f 0d 23 69 | 66 6e 64 65 66 20 49 73 |l..*/.#i|fndef Is|
|00002570| 46 69 6e 69 74 65 0d 09 | 23 64 65 66 69 6e 65 20 |Finite..|#define |
|00002580| 49 73 4e 61 6e 28 78 29 | 20 30 0d 09 23 64 65 66 |IsNan(x)| 0..#def|
|00002590| 69 6e 65 20 49 73 46 69 | 6e 69 74 65 28 78 29 20 |ine IsFi|nite(x) |
|000025a0| 31 0d 23 65 6e 64 69 66 | 0d 44 65 73 63 72 69 70 |1.#endif|.Descrip|
|000025b0| 74 69 6f 6e 20 53 65 74 | 41 56 61 72 69 61 62 6c |tion Set|AVariabl|
|000025c0| 65 28 73 68 6f 72 74 20 | 74 79 70 65 2c 76 6f 69 |e(short |type,voi|
|000025d0| 64 20 2a 70 74 72 2c 63 | 68 61 72 20 2a 6e 61 6d |d *ptr,c|har *nam|
|000025e0| 65 2c 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 20 |e,unsign|ed long |
|000025f0| 64 69 6d 0d 09 2c 63 6f | 6e 73 74 20 63 68 61 72 |dim..,co|nst char|
|00002600| 20 2a 63 6f 6d 6d 65 6e | 74 29 3b 09 2f 2a 20 6f | *commen|t);./* o|
|00002610| 6c 64 20 73 74 79 6c 65 | 20 2a 2f 0d 0d 2f 2a 20 |ld style| */../* |
|00002620| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 61 72 |the foll|owing ar|
|00002630| 65 20 70 72 69 76 61 74 | 65 2c 20 6e 6f 74 20 69 |e privat|e, not i|
|00002640| 6e 74 65 6e 64 65 64 20 | 66 6f 72 20 75 73 65 20 |ntended |for use |
|00002650| 6f 75 74 73 69 64 65 20 | 74 68 69 73 20 66 69 6c |outside |this fil|
|00002660| 65 20 2a 2f 0d 23 64 65 | 66 69 6e 65 20 49 73 49 |e */.#de|fine IsI|
|00002670| 6e 74 65 67 72 61 6c 28 | 74 79 70 65 29 20 28 28 |ntegral(|type) ((|
|00002680| 74 79 70 65 29 3e 3d 63 | 68 61 72 54 79 70 65 26 |type)>=c|harType&|
|00002690| 26 28 74 79 70 65 29 3c | 3d 75 6e 73 69 67 6e 65 |&(type)<|=unsigne|
|000026a0| 64 4c 6f 6e 67 54 79 70 | 65 20 7c 7c 20 28 74 79 |dLongTyp|e || (ty|
|000026b0| 70 65 29 3e 3d 63 68 61 | 72 50 74 72 54 79 70 65 |pe)>=cha|rPtrType|
|000026c0| 26 26 28 74 79 70 65 29 | 3c 3d 75 6e 73 69 67 6e |&&(type)|<=unsign|
|000026d0| 65 64 4c 6f 6e 67 50 74 | 72 54 79 70 65 29 0d 23 |edLongPt|rType).#|
|000026e0| 64 65 66 69 6e 65 20 49 | 73 46 6c 6f 61 74 69 6e |define I|sFloatin|
|000026f0| 67 28 74 79 70 65 29 20 | 28 28 74 79 70 65 29 3e |g(type) |((type)>|
|00002700| 3d 66 6c 6f 61 74 54 79 | 70 65 26 26 28 74 79 70 |=floatTy|pe&&(typ|
|00002710| 65 29 3c 3d 64 6f 75 62 | 6c 65 54 79 70 65 20 7c |e)<=doub|leType ||
|00002720| 7c 20 28 74 79 70 65 29 | 3e 3d 66 6c 6f 61 74 50 || (type)|>=floatP|
|00002730| 74 72 54 79 70 65 26 26 | 28 74 79 70 65 29 3c 3d |trType&&|(type)<=|
|00002740| 64 6f 75 62 6c 65 50 74 | 72 54 79 70 65 29 0d 23 |doublePt|rType).#|
|00002750| 64 65 66 69 6e 65 20 49 | 73 53 74 72 69 6e 67 28 |define I|sString(|
|00002760| 74 79 70 65 29 20 28 74 | 79 70 65 3d 3d 73 74 72 |type) (t|ype==str|
|00002770| 69 6e 67 54 79 70 65 29 | 0d 23 64 65 66 69 6e 65 |ingType)|.#define|
|00002780| 20 49 73 50 74 72 28 74 | 79 70 65 29 20 28 28 74 | IsPtr(t|ype) ((t|
|00002790| 79 70 65 29 3e 3d 63 68 | 61 72 50 74 72 54 79 70 |ype)>=ch|arPtrTyp|
|000027a0| 65 26 26 28 74 79 70 65 | 29 3c 3d 64 6f 75 62 6c |e&&(type|)<=doubl|
|000027b0| 65 50 74 72 54 79 70 65 | 29 0d 6c 6f 6e 67 20 43 |ePtrType|).long C|
|000027c0| 68 65 63 6b 41 44 65 73 | 63 72 69 70 74 69 6f 6e |heckADes|cription|
|000027d0| 28 44 65 73 63 72 69 70 | 74 69 6f 6e 20 2a 64 2c |(Descrip|tion *d,|
|000027e0| 63 6f 6e 73 74 20 63 68 | 61 72 20 2a 68 65 72 65 |const ch|ar *here|
|000027f0| 2c 73 68 6f 72 74 20 66 | 6c 61 67 73 29 3b 0d 6c |,short f|lags);.l|
|00002800| 6f 6e 67 20 43 68 65 63 | 6b 44 65 73 63 72 69 70 |ong Chec|kDescrip|
|00002810| 74 69 6f 6e 73 28 44 65 | 73 63 72 69 70 74 69 6f |tions(De|scriptio|
|00002820| 6e 20 64 5b 5d 2c 63 6f | 6e 73 74 20 63 68 61 72 |n d[],co|nst char|
|00002830| 20 2a 68 65 72 65 2c 73 | 68 6f 72 74 20 66 6c 61 | *here,s|hort fla|
|00002840| 67 73 29 3b 0d 76 6f 69 | 64 20 46 72 65 65 41 50 |gs);.voi|d FreeAP|
|00002850| 74 72 44 65 73 63 72 69 | 70 74 69 6f 6e 28 44 65 |trDescri|ption(De|
|00002860| 73 63 72 69 70 74 69 6f | 6e 20 2a 64 2c 73 68 6f |scriptio|n *d,sho|
|00002870| 72 74 20 66 6c 61 67 73 | 29 3b 0d 76 6f 69 64 20 |rt flags|);.void |
|00002880| 46 72 65 65 41 53 74 72 | 69 6e 67 44 65 73 63 72 |FreeAStr|ingDescr|
|00002890| 69 70 74 69 6f 6e 28 44 | 65 73 63 72 69 70 74 69 |iption(D|escripti|
|000028a0| 6f 6e 20 2a 64 2c 73 68 | 6f 72 74 20 66 6c 61 67 |on *d,sh|ort flag|
|000028b0| 73 29 3b 0d 63 68 61 72 | 20 2a 47 65 74 4e 61 6d |s);.char| *GetNam|
|000028c0| 65 28 63 68 61 72 20 2a | 2a 73 50 74 72 2c 73 68 |e(char *|*sPtr,sh|
|000028d0| 6f 72 74 20 66 6c 61 67 | 73 29 3b 0d 63 68 61 72 |ort flag|s);.char|
|000028e0| 20 2a 47 65 74 51 75 6f | 74 65 64 53 74 72 69 6e | *GetQuo|tedStrin|
|000028f0| 67 28 46 49 4c 45 20 2a | 73 74 72 65 61 6d 2c 63 |g(FILE *|stream,c|
|00002900| 68 61 72 20 2a 6c 69 6e | 65 42 75 66 66 65 72 2c |har *lin|eBuffer,|
|00002910| 63 68 61 72 20 2a 73 2c | 63 68 61 72 20 2a 2a 73 |char *s,|char **s|
|00002920| 50 74 72 2c 73 68 6f 72 | 74 20 66 6c 61 67 73 29 |Ptr,shor|t flags)|
|00002930| 3b 0d 6c 6f 6e 67 20 48 | 65 78 41 73 73 69 67 6e |;.long H|exAssign|
|00002940| 6d 65 6e 74 28 46 49 4c | 45 20 2a 73 74 72 65 61 |ment(FIL|E *strea|
|00002950| 6d 2c 63 68 61 72 20 2a | 6c 69 6e 65 42 75 66 66 |m,char *|lineBuff|
|00002960| 65 72 2c 63 68 61 72 20 | 2a 2a 73 50 74 72 2c 44 |er,char |**sPtr,D|
|00002970| 65 73 63 72 69 70 74 69 | 6f 6e 20 2a 64 0d 09 2c |escripti|on *d..,|
|00002980| 69 6e 74 20 73 75 62 73 | 63 72 69 70 74 44 69 6d |int subs|criptDim|
|00002990| 73 2c 6c 6f 6e 67 20 69 | 6e 64 65 78 2c 6c 6f 6e |s,long i|ndex,lon|
|000029a0| 67 20 2a 62 79 74 65 73 | 50 74 72 2c 73 68 6f 72 |g *bytes|Ptr,shor|
|000029b0| 74 20 66 6c 61 67 73 29 | 3b 0d 63 68 61 72 20 2a |t flags)|;.char *|
|000029c0| 4e 65 78 74 54 6f 6b 65 | 6e 28 46 49 4c 45 20 2a |NextToke|n(FILE *|
|000029d0| 73 74 72 65 61 6d 2c 63 | 68 61 72 20 2a 6c 69 6e |stream,c|har *lin|
|000029e0| 65 42 75 66 66 65 72 2c | 63 68 61 72 20 2a 73 2c |eBuffer,|char *s,|
|000029f0| 73 68 6f 72 74 20 66 6c | 61 67 73 29 3b 0d 63 68 |short fl|ags);.ch|
|00002a00| 61 72 20 2a 4e 65 78 74 | 54 6f 6b 65 6e 49 6e 4c |ar *Next|TokenInL|
|00002a10| 69 6e 65 28 46 49 4c 45 | 20 2a 73 74 72 65 61 6d |ine(FILE| *stream|
|00002a20| 2c 63 68 61 72 20 2a 6c | 69 6e 65 42 75 66 66 65 |,char *l|ineBuffe|
|00002a30| 72 2c 63 68 61 72 20 2a | 73 2c 73 68 6f 72 74 20 |r,char *|s,short |
|00002a40| 66 6c 61 67 73 29 3b 0d | 63 68 61 72 20 2a 4e 65 |flags);.|char *Ne|
|00002a50| 78 74 54 6f 6b 65 6e 49 | 6e 54 68 69 73 4f 72 4e |xtTokenI|nThisOrN|
|00002a60| 65 78 74 4c 69 6e 65 28 | 46 49 4c 45 20 2a 73 74 |extLine(|FILE *st|
|00002a70| 72 65 61 6d 2c 63 68 61 | 72 20 2a 6c 69 6e 65 42 |ream,cha|r *lineB|
|00002a80| 75 66 66 65 72 2c 63 68 | 61 72 20 2a 73 2c 73 68 |uffer,ch|ar *s,sh|
|00002a90| 6f 72 74 20 66 6c 61 67 | 73 29 3b 0d 69 6e 74 20 |ort flag|s);.int |
|00002aa0| 50 61 72 73 65 4e 61 6d | 65 28 63 68 61 72 20 2a |ParseNam|e(char *|
|00002ab0| 2a 73 50 74 72 29 3b 0d | 76 6f 69 64 20 50 61 72 |*sPtr);.|void Par|
|00002ac0| 73 69 6e 67 45 72 72 6f | 72 28 63 68 61 72 20 2a |singErro|r(char *|
|00002ad0| 73 2c 63 68 61 72 20 2a | 66 6f 72 6d 61 74 2c 2e |s,char *|format,.|
|00002ae0| 2e 2e 29 3b 0d 6c 6f 6e | 67 20 50 72 69 6e 74 41 |..);.lon|g PrintA|
|00002af0| 6e 41 73 73 69 67 6e 6d | 65 6e 74 4f 66 45 6c 65 |nAssignm|entOfEle|
|00002b00| 6d 65 6e 74 28 46 49 4c | 45 20 2a 73 74 72 65 61 |ment(FIL|E *strea|
|00002b10| 6d 2c 44 65 73 63 72 69 | 70 74 69 6f 6e 20 2a 64 |m,Descri|ption *d|
|00002b20| 2c 6c 6f 6e 67 20 69 6e | 64 65 78 2c 73 68 6f 72 |,long in|dex,shor|
|00002b30| 74 20 66 6c 61 67 73 29 | 3b 0d 76 6f 69 64 20 50 |t flags)|;.void P|
|00002b40| 72 69 6e 74 51 75 6f 74 | 65 64 53 74 72 69 6e 67 |rintQuot|edString|
|00002b50| 28 46 49 4c 45 20 2a 73 | 74 72 65 61 6d 2c 73 68 |(FILE *s|tream,sh|
|00002b60| 6f 72 74 20 2a 6c 69 6e | 65 4c 65 6e 67 74 68 50 |ort *lin|eLengthP|
|00002b70| 74 72 2c 63 6f 6e 73 74 | 20 63 68 61 72 20 2a 73 |tr,const| char *s|
|00002b80| 0d 09 2c 63 6f 6e 73 74 | 20 63 68 61 72 20 2a 6f |..,const| char *o|
|00002b90| 70 65 6e 51 75 6f 74 65 | 2c 63 6f 6e 73 74 20 63 |penQuote|,const c|
|00002ba0| 68 61 72 20 2a 63 6c 6f | 73 65 51 75 6f 74 65 29 |har *clo|seQuote)|
|00002bb0| 3b 0d 63 68 61 72 20 2a | 52 65 61 64 4c 69 6e 65 |;.char *|ReadLine|
|00002bc0| 28 63 68 61 72 20 2a 6c | 69 6e 65 42 75 66 66 65 |(char *l|ineBuffe|
|00002bd0| 72 2c 73 69 7a 65 5f 74 | 20 62 75 66 66 65 72 53 |r,size_t| bufferS|
|00002be0| 69 7a 65 2c 46 49 4c 45 | 20 2a 73 74 72 65 61 6d |ize,FILE| *stream|
|00002bf0| 2c 73 68 6f 72 74 20 66 | 6c 61 67 73 29 3b 0d 64 |,short f|lags);.d|
|00002c00| 6f 75 62 6c 65 20 73 74 | 72 74 6f 64 4e 28 63 68 |ouble st|rtodN(ch|
|00002c10| 61 72 20 2a 73 2c 63 68 | 61 72 20 2a 2a 73 50 74 |ar *s,ch|ar **sPt|
|00002c20| 72 29 3b 0d 6c 6f 6e 67 | 20 73 74 72 74 6f 6c 4e |r);.long| strtolN|
|00002c30| 28 63 68 61 72 20 2a 73 | 2c 63 68 61 72 20 2a 2a |(char *s|,char **|
|00002c40| 73 50 74 72 2c 73 68 6f | 72 74 20 66 6c 61 67 73 |sPtr,sho|rt flags|
|00002c50| 29 3b 0d 75 6e 73 69 67 | 6e 65 64 20 6c 6f 6e 67 |);.unsig|ned long|
|00002c60| 20 73 74 72 74 6f 75 6c | 4e 28 63 68 61 72 20 2a | strtoul|N(char *|
|00002c70| 73 2c 63 68 61 72 20 2a | 2a 73 50 74 72 2c 73 68 |s,char *|*sPtr,sh|
|00002c80| 6f 72 74 20 66 6c 61 67 | 73 29 3b 0d 63 68 61 72 |ort flag|s);.char|
|00002c90| 20 73 74 72 74 6f 63 28 | 63 68 61 72 20 2a 73 2c | strtoc(|char *s,|
|00002ca0| 63 68 61 72 20 2a 2a 73 | 50 74 72 29 3b 0d 23 64 |char **s|Ptr);.#d|
|00002cb0| 65 66 69 6e 65 20 73 74 | 72 65 71 32 28 73 31 2c |efine st|req2(s1,|
|00002cc0| 73 32 29 20 28 73 74 72 | 6e 63 6d 70 28 73 31 2c |s2) (str|ncmp(s1,|
|00002cd0| 73 32 2c 73 74 72 6c 65 | 6e 28 73 32 29 29 3d 3d |s2,strle|n(s2))==|
|00002ce0| 30 29 0d 23 64 65 66 69 | 6e 65 20 73 74 72 65 71 |0).#defi|ne streq|
|00002cf0| 28 73 31 2c 73 32 29 20 | 28 73 74 72 63 6d 70 28 |(s1,s2) |(strcmp(|
|00002d00| 73 31 2c 73 32 29 3d 3d | 30 29 0d 6c 6f 6e 67 20 |s1,s2)==|0).long |
|00002d10| 44 69 6d 73 28 44 65 73 | 63 72 69 70 74 69 6f 6e |Dims(Des|cription|
|00002d20| 20 2a 64 29 3b 0d 63 68 | 61 72 20 2a 45 6c 65 6d | *d);.ch|ar *Elem|
|00002d30| 65 6e 74 4e 61 6d 65 28 | 63 68 61 72 20 2a 73 2c |entName(|char *s,|
|00002d40| 44 65 73 63 72 69 70 74 | 69 6f 6e 20 2a 64 2c 6c |Descript|ion *d,l|
|00002d50| 6f 6e 67 20 69 6e 64 65 | 78 29 3b 0d 76 6f 69 64 |ong inde|x);.void|
|00002d60| 20 2a 45 6c 65 6d 65 6e | 74 50 74 72 28 44 65 73 | *Elemen|tPtr(Des|
|00002d70| 63 72 69 70 74 69 6f 6e | 20 2a 64 2c 6c 6f 6e 67 |cription| *d,long|
|00002d80| 20 69 6e 64 65 78 29 3b | 0d 6c 6f 6e 67 20 45 6c | index);|.long El|
|00002d90| 65 6d 65 6e 74 73 28 44 | 65 73 63 72 69 70 74 69 |ements(D|escripti|
|00002da0| 6f 6e 20 2a 64 29 3b 0d | 76 6f 69 64 20 45 6c 65 |on *d);.|void Ele|
|00002db0| 6d 65 6e 74 53 75 62 73 | 63 72 69 70 74 28 44 65 |mentSubs|cript(De|
|00002dc0| 73 63 72 69 70 74 69 6f | 6e 20 2a 64 2c 6c 6f 6e |scriptio|n *d,lon|
|00002dd0| 67 20 69 6e 64 65 78 2c | 6c 6f 6e 67 20 73 75 62 |g index,|long sub|
|00002de0| 5b 41 53 53 49 47 4e 5f | 44 49 4d 53 5d 29 3b 0d |[ASSIGN_|DIMS]);.|
|00002df0| 6c 6f 6e 67 20 45 6c 65 | 6d 65 6e 74 49 6e 64 65 |long Ele|mentInde|
|00002e00| 78 28 44 65 73 63 72 69 | 70 74 69 6f 6e 20 2a 64 |x(Descri|ption *d|
|00002e10| 2c 6c 6f 6e 67 20 73 75 | 62 5b 41 53 53 49 47 4e |,long su|b[ASSIGN|
|00002e20| 5f 44 49 4d 53 5d 29 3b | 0d 69 6e 74 20 47 65 74 |_DIMS]);|.int Get|
|00002e30| 44 69 6d 65 6e 73 69 6f | 6e 73 28 44 65 73 63 72 |Dimensio|ns(Descr|
|00002e40| 69 70 74 69 6f 6e 20 2a | 64 2c 69 6e 74 20 73 75 |iption *|d,int su|
|00002e50| 62 73 63 72 69 70 74 44 | 69 6d 73 2c 6c 6f 6e 67 |bscriptD|ims,long|
|00002e60| 20 73 75 62 73 63 72 69 | 70 74 5b 41 53 53 49 47 | subscri|pt[ASSIG|
|00002e70| 4e 5f 44 49 4d 53 5d 2c | 73 68 6f 72 74 20 66 6c |N_DIMS],|short fl|
|00002e80| 61 67 73 29 3b 0d 69 6e | 74 20 41 6c 6c 6f 63 61 |ags);.in|t Alloca|
|00002e90| 74 65 44 65 73 63 72 69 | 62 65 64 50 74 72 56 61 |teDescri|bedPtrVa|
|00002ea0| 72 73 28 44 65 73 63 72 | 69 70 74 69 6f 6e 20 64 |rs(Descr|iption d|
|00002eb0| 65 73 63 72 69 70 74 69 | 6f 6e 5b 5d 2c 63 6f 6e |escripti|on[],con|
|00002ec0| 73 74 20 63 68 61 72 20 | 2a 68 65 72 65 2c 73 68 |st char |*here,sh|
|00002ed0| 6f 72 74 20 66 6c 61 67 | 73 29 3b 0d 23 69 66 6e |ort flag|s);.#ifn|
|00002ee0| 64 65 66 20 54 52 55 45 | 0d 09 23 64 65 66 69 6e |def TRUE|..#defin|
|00002ef0| 65 20 46 41 4c 53 45 09 | 30 0d 09 23 64 65 66 69 |e FALSE.|0..#defi|
|00002f00| 6e 65 20 54 52 55 45 09 | 31 0d 23 65 6e 64 69 66 |ne TRUE.|1.#endif|
|00002f10| 0d 23 64 65 66 69 6e 65 | 20 54 4f 4c 45 52 41 4e |.#define| TOLERAN|
|00002f20| 43 45 09 31 65 2d 36 09 | 2f 2a 20 66 72 61 63 74 |CE.1e-6.|/* fract|
|00002f30| 69 6f 6e 61 6c 20 64 69 | 66 66 65 72 65 6e 63 65 |ional di|fference|
|00002f40| 20 62 65 74 77 65 65 6e | 20 74 77 6f 20 22 65 71 | between| two "eq|
|00002f50| 75 61 6c 22 20 66 6c 6f | 61 74 73 20 2a 2f 0d 23 |ual" flo|ats */.#|
|00002f60| 64 65 66 69 6e 65 20 42 | 55 46 46 45 52 5f 53 49 |define B|UFFER_SI|
|00002f70| 5a 45 20 35 31 32 0d 23 | 64 65 66 69 6e 65 20 45 |ZE 512.#|define E|
|00002f80| 43 48 4f 5f 41 53 53 49 | 47 4e 4d 45 4e 54 53 09 |CHO_ASSI|GNMENTS.|
|00002f90| 28 66 6c 61 67 73 26 61 | 73 73 69 67 6e 45 63 68 |(flags&a|ssignEch|
|00002fa0| 6f 41 73 73 69 67 6e 6d | 65 6e 74 73 20 26 26 20 |oAssignm|ents && |
|00002fb0| 21 28 66 6c 61 67 73 26 | 61 73 73 69 67 6e 53 63 |!(flags&|assignSc|
|00002fc0| 61 6e 29 29 0d 23 64 65 | 66 69 6e 65 20 45 43 48 |an)).#de|fine ECH|
|00002fd0| 4f 5f 43 4f 4d 4d 45 4e | 54 53 09 09 28 66 6c 61 |O_COMMEN|TS..(fla|
|00002fe0| 67 73 26 61 73 73 69 67 | 6e 45 63 68 6f 43 6f 6d |gs&assig|nEchoCom|
|00002ff0| 6d 65 6e 74 73 20 26 26 | 20 21 28 66 6c 61 67 73 |ments &&| !(flags|
|00003000| 26 61 73 73 69 67 6e 53 | 63 61 6e 29 29 0d 23 64 |&assignS|can)).#d|
|00003010| 65 66 69 6e 65 20 45 43 | 48 4f 5f 46 49 4c 45 09 |efine EC|HO_FILE.|
|00003020| 09 09 28 66 6c 61 67 73 | 26 61 73 73 69 67 6e 45 |..(flags|&assignE|
|00003030| 63 68 6f 46 69 6c 65 20 | 26 26 20 21 28 66 6c 61 |choFile |&& !(fla|
|00003040| 67 73 26 61 73 73 69 67 | 6e 53 63 61 6e 29 29 0d |gs&assig|nScan)).|
|00003050| 23 64 65 66 69 6e 65 20 | 50 52 49 4e 54 46 5f 45 |#define |PRINTF_E|
|00003060| 58 49 54 09 09 09 21 28 | 66 6c 61 67 73 26 61 73 |XIT...!(|flags&as|
|00003070| 73 69 67 6e 4e 6f 50 72 | 69 6e 74 66 45 78 69 74 |signNoPr|intfExit|
|00003080| 29 0d 0d 73 74 61 74 69 | 63 20 69 6e 74 20 6c 69 |)..stati|c int li|
|00003090| 6e 65 57 61 73 42 6c 61 | 6e 6b 3d 31 3b 09 2f 2a |neWasBla|nk=1;./*|
|000030a0| 20 75 73 65 64 20 69 6e | 20 52 65 61 64 41 73 73 | used in| ReadAss|
|000030b0| 69 67 6e 6d 65 6e 74 4c | 69 6e 65 28 29 2c 09 2a |ignmentL|ine(),.*|
|000030c0| 2f 0d 09 09 09 2f 2a 20 | 4e 65 78 74 54 6f 6b 65 |/..../* |NextToke|
|000030d0| 6e 49 6e 54 68 69 73 4f | 72 4e 65 78 74 4c 69 6e |nInThisO|rNextLin|
|000030e0| 65 28 29 2c 20 61 6e 64 | 20 41 73 73 69 67 6e 6d |e(), and| Assignm|
|000030f0| 65 6e 74 4c 69 6e 65 57 | 61 73 42 6c 61 6e 6b 28 |entLineW|asBlank(|
|00003100| 29 2e 2a 2f 0d 73 68 6f | 72 74 20 74 79 70 65 53 |).*/.sho|rt typeS|
|00003110| 69 7a 65 5b 5d 3d 7b 30 | 0d 09 2c 73 69 7a 65 6f |ize[]={0|..,sizeo|
|00003120| 66 28 63 68 61 72 29 2c | 73 69 7a 65 6f 66 28 75 |f(char),|sizeof(u|
|00003130| 6e 73 69 67 6e 65 64 20 | 63 68 61 72 29 0d 09 2c |nsigned |char)..,|
|00003140| 73 69 7a 65 6f 66 28 73 | 68 6f 72 74 29 2c 73 69 |sizeof(s|hort),si|
|00003150| 7a 65 6f 66 28 75 6e 73 | 69 67 6e 65 64 20 73 68 |zeof(uns|igned sh|
|00003160| 6f 72 74 29 0d 09 2c 73 | 69 7a 65 6f 66 28 6c 6f |ort)..,s|izeof(lo|
|00003170| 6e 67 29 2c 73 69 7a 65 | 6f 66 28 75 6e 73 69 67 |ng),size|of(unsig|
|00003180| 6e 65 64 20 6c 6f 6e 67 | 29 0d 09 2c 73 69 7a 65 |ned long|)..,size|
|00003190| 6f 66 28 66 6c 6f 61 74 | 29 0d 09 23 69 66 20 53 |of(float|)..#if S|
|000031a0| 48 4f 52 54 5f 44 4f 55 | 42 4c 45 5f 4f 4b 0d 09 |HORT_DOU|BLE_OK..|
|000031b0| 09 2c 73 69 7a 65 6f 66 | 28 73 68 6f 72 74 20 64 |.,sizeof|(short d|
|000031c0| 6f 75 62 6c 65 29 0d 09 | 23 65 6e 64 69 66 0d 09 |ouble)..|#endif..|
|000031d0| 2c 73 69 7a 65 6f 66 28 | 64 6f 75 62 6c 65 29 0d |,sizeof(|double).|
|000031e0| 09 2c 73 69 7a 65 6f 66 | 28 63 68 61 72 29 2c 73 |.,sizeof|(char),s|
|000031f0| 69 7a 65 6f 66 28 75 6e | 73 69 67 6e 65 64 20 63 |izeof(un|signed c|
|00003200| 68 61 72 29 0d 09 2c 73 | 69 7a 65 6f 66 28 73 68 |har)..,s|izeof(sh|
|00003210| 6f 72 74 29 2c 73 69 7a | 65 6f 66 28 75 6e 73 69 |ort),siz|eof(unsi|
|00003220| 67 6e 65 64 20 73 68 6f | 72 74 29 0d 09 2c 73 69 |gned sho|rt)..,si|
|00003230| 7a 65 6f 66 28 6c 6f 6e | 67 29 2c 73 69 7a 65 6f |zeof(lon|g),sizeo|
|00003240| 66 28 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 29 |f(unsign|ed long)|
|00003250| 0d 09 2c 73 69 7a 65 6f | 66 28 66 6c 6f 61 74 29 |..,sizeo|f(float)|
|00003260| 0d 09 23 69 66 20 53 48 | 4f 52 54 5f 44 4f 55 42 |..#if SH|ORT_DOUB|
|00003270| 4c 45 5f 4f 4b 0d 09 09 | 2c 73 69 7a 65 6f 66 28 |LE_OK...|,sizeof(|
|00003280| 73 68 6f 72 74 20 64 6f | 75 62 6c 65 29 0d 09 23 |short do|uble)..#|
|00003290| 65 6e 64 69 66 0d 09 2c | 73 69 7a 65 6f 66 28 64 |endif..,|sizeof(d|
|000032a0| 6f 75 62 6c 65 29 0d 09 | 2c 73 69 7a 65 6f 66 28 |ouble)..|,sizeof(|
|000032b0| 63 68 61 72 20 2a 29 0d | 09 2c 30 0d 7d 3b 0d 63 |char *).|.,0.};.c|
|000032c0| 68 61 72 20 74 79 70 65 | 4e 61 6d 65 5b 5d 5b 32 |har type|Name[][2|
|000032d0| 30 5d 3d 7b 22 6e 6f 6e | 65 22 0d 09 2c 22 63 68 |0]={"non|e"..,"ch|
|000032e0| 61 72 22 2c 22 75 6e 73 | 69 67 6e 65 64 20 63 68 |ar","uns|igned ch|
|000032f0| 61 72 22 2c 22 73 68 6f | 72 74 22 2c 22 75 6e 73 |ar","sho|rt","uns|
|00003300| 69 67 6e 65 64 20 73 68 | 6f 72 74 22 0d 09 2c 22 |igned sh|ort"..,"|
|00003310| 6c 6f 6e 67 22 2c 22 75 | 6e 73 69 67 6e 65 64 20 |long","u|nsigned |
|00003320| 6c 6f 6e 67 22 2c 22 66 | 6c 6f 61 74 22 0d 09 23 |long","f|loat"..#|
|00003330| 69 66 20 53 48 4f 52 54 | 5f 44 4f 55 42 4c 45 5f |if SHORT|_DOUBLE_|
|00003340| 4f 4b 0d 09 09 2c 22 73 | 68 6f 72 74 20 64 6f 75 |OK...,"s|hort dou|
|00003350| 62 6c 65 22 0d 09 23 65 | 6e 64 69 66 0d 09 2c 22 |ble"..#e|ndif..,"|
|00003360| 64 6f 75 62 6c 65 22 0d | 09 2c 22 63 68 61 72 20 |double".|.,"char |
|00003370| 2a 22 2c 22 75 6e 73 69 | 67 6e 65 64 20 63 68 61 |*","unsi|gned cha|
|00003380| 72 20 2a 22 2c 22 73 68 | 6f 72 74 20 2a 22 2c 22 |r *","sh|ort *","|
|00003390| 75 6e 73 69 67 6e 65 64 | 20 73 68 6f 72 74 20 2a |unsigned| short *|
|000033a0| 22 0d 09 2c 22 6c 6f 6e | 67 20 2a 22 2c 22 75 6e |"..,"lon|g *","un|
|000033b0| 73 69 67 6e 65 64 20 6c | 6f 6e 67 20 2a 22 2c 22 |signed l|ong *","|
|000033c0| 66 6c 6f 61 74 20 2a 22 | 0d 09 23 69 66 20 53 48 |float *"|..#if SH|
|000033d0| 4f 52 54 5f 44 4f 55 42 | 4c 45 5f 4f 4b 0d 09 09 |ORT_DOUB|LE_OK...|
|000033e0| 2c 22 73 68 6f 72 74 20 | 64 6f 75 62 6c 65 20 2a |,"short |double *|
|000033f0| 22 0d 09 23 65 6e 64 69 | 66 0d 09 2c 22 64 6f 75 |"..#endi|f..,"dou|
|00003400| 62 6c 65 20 2a 22 0d 09 | 2c 22 73 74 72 69 6e 67 |ble *"..|,"string|
|00003410| 22 0d 09 2c 22 75 6e 6b | 6e 6f 77 6e 22 0d 7d 3b |"..,"unk|nown".};|
|00003420| 0d 65 6e 75 6d 7b 61 73 | 73 69 67 6e 4e 65 65 64 |.enum{as|signNeed|
|00003430| 4d 6f 72 65 3d 30 78 34 | 30 30 30 2c 61 73 73 69 |More=0x4|000,assi|
|00003440| 67 6e 41 6c 72 65 61 64 | 79 43 68 65 63 6b 65 64 |gnAlread|yChecked|
|00003450| 3d 30 78 32 30 30 30 0d | 09 2c 61 73 73 69 67 6e |=0x2000.|.,assign|
|00003460| 53 63 61 6e 3d 30 78 31 | 30 30 2c 61 73 73 69 67 |Scan=0x1|00,assig|
|00003470| 6e 4c 6f 63 61 6c 43 61 | 6c 6c 3d 30 78 32 30 30 |nLocalCa|ll=0x200|
|00003480| 0d 7d 3b 2f 2a 66 6c 61 | 67 73 20 75 73 65 64 20 |.};/*fla|gs used |
|00003490| 6f 6e 6c 79 20 69 6e 20 | 74 68 69 73 20 66 69 6c |only in |this fil|
|000034a0| 65 2a 2f 0d 0d 2f 2a 0d | 52 4f 55 54 49 4e 45 3a |e*/../*.|ROUTINE:|
|000034b0| 20 4f 70 65 6e 43 61 6c | 46 69 6c 65 52 65 61 64 | OpenCal|FileRead|
|000034c0| 41 6e 64 43 68 65 63 6b | 0d 50 55 52 50 4f 53 45 |AndCheck|.PURPOSE|
|000034d0| 3a 0d 09 4f 70 65 6e 20 | 75 70 20 61 20 63 61 6c |:..Open |up a cal|
|000034e0| 69 62 72 61 74 69 6f 6e | 20 66 69 6c 65 20 66 6f |ibration| file fo|
|000034f0| 72 20 72 65 61 64 69 6e | 67 2e 0d 09 0d 09 49 66 |r readin|g.....If|
|00003500| 20 74 68 65 20 66 69 6c | 65 20 65 78 69 73 74 73 | the fil|e exists|
|00003510| 20 69 6e 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | in the |current |
|00003520| 64 69 72 65 63 74 6f 72 | 79 2c 20 69 74 20 69 73 |director|y, it is|
|00003530| 20 75 73 65 64 2e 0d 09 | 49 66 20 6e 6f 74 2c 20 | used...|If not, |
|00003540| 74 68 65 6e 20 69 66 20 | 69 74 20 65 78 69 73 74 |then if |it exist|
|00003550| 73 20 69 6e 20 74 68 65 | 20 70 72 65 66 65 72 65 |s in the| prefere|
|00003560| 6e 63 65 73 20 66 6f 6c | 64 65 72 2c 20 69 74 20 |nces fol|der, it |
|00003570| 75 73 65 64 2e 0d 2a 2f | 0d 0d 46 49 4c 45 20 2a |used..*/|..FILE *|
|00003580| 4f 70 65 6e 43 61 6c 46 | 69 6c 65 52 65 61 64 41 |OpenCalF|ileReadA|
|00003590| 6e 64 43 68 65 63 6b 28 | 63 68 61 72 20 2a 66 69 |ndCheck(|char *fi|
|000035a0| 6c 65 6e 61 6d 65 29 0d | 7b 0d 09 46 49 4c 45 20 |lename).|{..FILE |
|000035b0| 2a 73 74 72 65 61 6d 3b | 0d 09 0d 09 73 74 72 65 |*stream;|....stre|
|000035c0| 61 6d 20 3d 20 4f 70 65 | 6e 43 61 6c 46 69 6c 65 |am = Ope|nCalFile|
|000035d0| 52 65 61 64 28 66 69 6c | 65 6e 61 6d 65 29 3b 0d |Read(fil|ename);.|
|000035e0| 09 69 66 20 28 73 74 72 | 65 61 6d 20 3d 3d 20 4e |.if (str|eam == N|
|000035f0| 55 4c 4c 29 0d 09 09 50 | 72 69 6e 74 66 45 78 69 |ULL)...P|rintfExi|
|00003600| 74 28 22 4f 70 65 6e 43 | 61 6c 46 69 6c 65 52 65 |t("OpenC|alFileRe|
|00003610| 61 64 41 6e 64 43 68 65 | 63 6b 3a 20 63 61 6e 6e |adAndChe|ck: cann|
|00003620| 6f 74 20 6f 70 65 6e 20 | 66 69 6c 65 20 5c 22 25 |ot open |file \"%|
|00003630| 73 5c 22 22 2c 66 69 6c | 65 6e 61 6d 65 29 3b 0d |s\"",fil|ename);.|
|00003640| 09 72 65 74 75 72 6e 28 | 73 74 72 65 61 6d 29 3b |.return(|stream);|
|00003650| 09 0d 7d 0d 0d 2f 2a 0d | 52 4f 55 54 49 4e 45 3a |..}../*.|ROUTINE:|
|00003660| 20 4f 70 65 6e 43 61 6c | 46 69 6c 65 52 65 61 64 | OpenCal|FileRead|
|00003670| 0d 50 55 52 50 4f 53 45 | 3a 0d 09 4f 70 65 6e 20 |.PURPOSE|:..Open |
|00003680| 75 70 20 61 20 63 61 6c | 69 62 72 61 74 69 6f 6e |up a cal|ibration|
|00003690| 20 66 69 6c 65 20 66 6f | 72 20 72 65 61 64 69 6e | file fo|r readin|
|000036a0| 67 2e 20 20 44 6f 6e 27 | 74 20 61 62 6f 72 74 20 |g. Don'|t abort |
|000036b0| 6f 6e 20 65 72 72 6f 72 | 2e 0d 09 0d 09 49 66 20 |on error|.....If |
|000036c0| 74 68 65 20 66 69 6c 65 | 20 65 78 69 73 74 73 20 |the file| exists |
|000036d0| 69 6e 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 64 |in the c|urrent d|
|000036e0| 69 72 65 63 74 6f 72 79 | 2c 20 69 74 20 69 73 20 |irectory|, it is |
|000036f0| 75 73 65 64 2e 0d 09 49 | 66 20 6e 6f 74 2c 20 74 |used...I|f not, t|
|00003700| 68 65 6e 20 69 66 20 69 | 74 20 65 78 69 73 74 73 |hen if i|t exists|
|00003710| 20 69 6e 20 74 68 65 20 | 70 72 65 66 65 72 65 6e | in the |preferen|
|00003720| 63 65 73 20 66 6f 6c 64 | 65 72 2c 20 69 74 20 75 |ces fold|er, it u|
|00003730| 73 65 64 2e 0d 2a 2f 0d | 0d 46 49 4c 45 20 2a 4f |sed..*/.|.FILE *O|
|00003740| 70 65 6e 43 61 6c 46 69 | 6c 65 52 65 61 64 28 63 |penCalFi|leRead(c|
|00003750| 68 61 72 20 2a 66 69 6c | 65 6e 61 6d 65 29 0d 7b |har *fil|ename).{|
|00003760| 0d 09 46 49 4c 45 20 2a | 73 74 72 65 61 6d 3b 0d |..FILE *|stream;.|
|00003770| 09 0d 09 2f 2a 20 54 72 | 79 20 74 68 65 20 63 75 |.../* Tr|y the cu|
|00003780| 72 72 65 6e 74 20 64 69 | 72 65 63 74 6f 72 79 20 |rrent di|rectory |
|00003790| 2a 2f 0d 09 73 74 72 65 | 61 6d 20 3d 20 66 6f 70 |*/..stre|am = fop|
|000037a0| 65 6e 28 66 69 6c 65 6e | 61 6d 65 2c 22 72 22 29 |en(filen|ame,"r")|
|000037b0| 3b 0d 09 69 66 20 28 73 | 74 72 65 61 6d 20 21 3d |;..if (s|tream !=|
|000037c0| 20 4e 55 4c 4c 29 20 72 | 65 74 75 72 6e 28 73 74 | NULL) r|eturn(st|
|000037d0| 72 65 61 6d 29 3b 0d 09 | 0d 09 2f 2a 20 54 72 79 |ream);..|../* Try|
|000037e0| 20 74 68 65 20 70 72 65 | 66 65 72 65 6e 63 65 73 | the pre|ferences|
|000037f0| 20 66 6f 6c 64 65 72 20 | 2a 2f 0d 09 4f 70 65 6e | folder |*/..Open|
|00003800| 50 72 65 66 65 72 65 6e | 63 65 73 46 6f 6c 64 65 |Preferen|cesFolde|
|00003810| 72 28 29 3b 0d 09 73 74 | 72 65 61 6d 20 3d 20 66 |r();..st|ream = f|
|00003820| 6f 70 65 6e 28 66 69 6c | 65 6e 61 6d 65 2c 22 72 |open(fil|ename,"r|
|00003830| 22 29 3b 0d 09 43 6c 6f | 73 65 50 72 65 66 65 72 |");..Clo|sePrefer|
|00003840| 65 6e 63 65 73 46 6f 6c | 64 65 72 28 29 3b 0d 09 |encesFol|der();..|
|00003850| 72 65 74 75 72 6e 28 73 | 74 72 65 61 6d 29 3b 09 |return(s|tream);.|
|00003860| 0d 7d 0d 0d 2f 2a 0d 52 | 4f 55 54 49 4e 45 3a 20 |.}../*.R|OUTINE: |
|00003870| 4f 70 65 6e 43 61 6c 46 | 69 6c 65 57 72 69 74 65 |OpenCalF|ileWrite|
|00003880| 0d 50 55 52 50 4f 53 45 | 3a 0d 09 4f 70 65 6e 20 |.PURPOSE|:..Open |
|00003890| 75 70 20 61 20 63 61 6c | 69 62 72 61 74 69 6f 6e |up a cal|ibration|
|000038a0| 20 66 69 6c 65 20 66 6f | 72 20 61 70 70 65 6e 64 | file fo|r append|
|000038b0| 69 6e 67 2e 0d 09 0d 09 | 49 66 20 74 68 65 20 66 |ing.....|If the f|
|000038c0| 69 6c 65 20 65 78 69 73 | 74 73 20 69 6e 20 74 68 |ile exis|ts in th|
|000038d0| 65 20 63 75 72 72 65 6e | 74 20 64 69 72 65 63 74 |e curren|t direct|
|000038e0| 6f 72 79 2c 20 69 74 20 | 69 73 20 75 73 65 64 2e |ory, it |is used.|
|000038f0| 0d 09 49 66 20 6e 6f 74 | 2c 20 74 68 65 6e 20 69 |..If not|, then i|
|00003900| 66 20 69 74 20 65 78 69 | 73 74 73 20 69 6e 20 74 |f it exi|sts in t|
|00003910| 68 65 20 50 72 65 66 65 | 72 65 6e 63 65 73 20 66 |he Prefe|rences f|
|00003920| 6f 6c 64 65 72 2c 20 69 | 74 20 75 73 65 64 2e 0d |older, i|t used..|
|00003930| 09 49 66 20 6e 6f 74 2c | 20 74 68 65 20 66 69 6c |.If not,| the fil|
|00003940| 65 20 69 73 20 63 72 65 | 61 74 65 64 20 69 6e 20 |e is cre|ated in |
|00003950| 74 68 65 20 50 72 65 66 | 65 72 65 6e 63 65 73 20 |the Pref|erences |
|00003960| 66 6f 6c 64 65 72 2e 0d | 2a 2f 0d 0d 46 49 4c 45 |folder..|*/..FILE|
|00003970| 20 2a 4f 70 65 6e 43 61 | 6c 46 69 6c 65 57 72 69 | *OpenCa|lFileWri|
|00003980| 74 65 28 63 68 61 72 20 | 2a 66 69 6c 65 6e 61 6d |te(char |*filenam|
|00003990| 65 29 0d 7b 0d 09 46 49 | 4c 45 20 2a 73 74 72 65 |e).{..FI|LE *stre|
|000039a0| 61 6d 3b 0d 09 0d 09 2f | 2a 20 54 72 79 20 69 6e |am;..../|* Try in|
|000039b0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 64 69 72 | the cur|rent dir|
|000039c0| 65 63 74 6f 72 79 20 2a | 2f 0d 09 73 74 72 65 61 |ectory *|/..strea|
|000039d0| 6d 20 3d 20 66 6f 70 65 | 6e 28 66 69 6c 65 6e 61 |m = fope|n(filena|
|000039e0| 6d 65 2c 22 72 22 29 3b | 0d 09 69 66 20 28 73 74 |me,"r");|..if (st|
|000039f0| 72 65 61 6d 20 21 3d 20 | 4e 55 4c 4c 29 20 7b 0d |ream != |NULL) {.|
|00003a00| 09 09 66 63 6c 6f 73 65 | 28 73 74 72 65 61 6d 29 |..fclose|(stream)|
|00003a10| 3b 0d 09 09 73 74 72 65 | 61 6d 20 3d 20 66 6f 70 |;...stre|am = fop|
|00003a20| 65 6e 28 66 69 6c 65 6e | 61 6d 65 2c 22 61 22 29 |en(filen|ame,"a")|
|00003a30| 3b 0d 09 09 69 66 20 28 | 73 74 72 65 61 6d 20 3d |;...if (|stream =|
|00003a40| 3d 20 4e 55 4c 4c 29 0d | 09 09 09 50 72 69 6e 74 |= NULL).|...Print|
|00003a50| 66 45 78 69 74 28 22 4f | 70 65 6e 43 61 6c 46 69 |fExit("O|penCalFi|
|00003a60| 6c 65 57 72 69 74 65 3a | 20 63 61 6e 6e 6f 74 20 |leWrite:| cannot |
|00003a70| 72 65 6f 70 65 6e 20 66 | 69 6c 65 20 5c 22 25 73 |reopen f|ile \"%s|
|00003a80| 5c 22 22 2c 66 69 6c 65 | 6e 61 6d 65 29 3b 0d 09 |\"",file|name);..|
|00003a90| 09 72 65 74 75 72 6e 28 | 73 74 72 65 61 6d 29 3b |.return(|stream);|
|00003aa0| 0d 09 7d 0d 09 0d 09 2f | 2a 20 54 72 79 20 74 68 |..}..../|* Try th|
|00003ab0| 65 20 50 72 65 66 65 72 | 65 6e 63 65 73 20 66 6f |e Prefer|ences fo|
|00003ac0| 6c 64 65 72 20 2a 2f 0d | 09 4f 70 65 6e 50 72 65 |lder */.|.OpenPre|
|00003ad0| 66 65 72 65 6e 63 65 73 | 46 6f 6c 64 65 72 28 29 |ferences|Folder()|
|00003ae0| 3b 0d 09 73 74 72 65 61 | 6d 20 3d 20 66 6f 70 65 |;..strea|m = fope|
|00003af0| 6e 28 66 69 6c 65 6e 61 | 6d 65 2c 22 72 22 29 3b |n(filena|me,"r");|
|00003b00| 0d 09 43 6c 6f 73 65 50 | 72 65 66 65 72 65 6e 63 |..CloseP|referenc|
|00003b10| 65 73 46 6f 6c 64 65 72 | 28 29 3b 0d 09 69 66 20 |esFolder|();..if |
|00003b20| 28 73 74 72 65 61 6d 20 | 21 3d 20 4e 55 4c 4c 29 |(stream |!= NULL)|
|00003b30| 20 7b 0d 09 09 66 63 6c | 6f 73 65 28 73 74 72 65 | {...fcl|ose(stre|
|00003b40| 61 6d 29 3b 0d 09 09 4f | 70 65 6e 50 72 65 66 65 |am);...O|penPrefe|
|00003b50| 72 65 6e 63 65 73 46 6f | 6c 64 65 72 28 29 3b 0d |rencesFo|lder();.|
|00003b60| 09 09 73 74 72 65 61 6d | 20 3d 20 66 6f 70 65 6e |..stream| = fopen|
|00003b70| 28 66 69 6c 65 6e 61 6d | 65 2c 22 61 22 29 3b 0d |(filenam|e,"a");.|
|00003b80| 09 09 43 6c 6f 73 65 50 | 72 65 66 65 72 65 6e 63 |..CloseP|referenc|
|00003b90| 65 73 46 6f 6c 64 65 72 | 28 29 3b 0d 09 09 69 66 |esFolder|();...if|
|00003ba0| 20 28 73 74 72 65 61 6d | 20 3d 3d 20 4e 55 4c 4c | (stream| == NULL|
|00003bb0| 29 0d 09 09 09 50 72 69 | 6e 74 66 45 78 69 74 28 |)....Pri|ntfExit(|
|00003bc0| 22 4f 70 65 6e 43 61 6c | 46 69 6c 65 57 72 69 74 |"OpenCal|FileWrit|
|00003bd0| 65 3a 20 63 61 6e 6e 6f | 74 20 72 65 6f 70 65 6e |e: canno|t reopen|
|00003be0| 20 66 69 6c 65 20 5c 22 | 25 73 5c 22 20 69 6e 20 | file \"|%s\" in |
|00003bf0| 50 72 65 66 65 72 65 6e | 63 65 73 20 66 6f 6c 64 |Preferen|ces fold|
|00003c00| 65 72 22 0d 09 09 09 09 | 2c 66 69 6c 65 6e 61 6d |er".....|,filenam|
|00003c10| 65 29 3b 0d 09 09 72 65 | 74 75 72 6e 28 73 74 72 |e);...re|turn(str|
|00003c20| 65 61 6d 29 3b 0d 09 7d | 0d 09 0d 09 2f 2a 20 43 |eam);..}|..../* C|
|00003c30| 72 65 61 74 65 20 69 74 | 20 69 6e 20 74 68 65 20 |reate it| in the |
|00003c40| 50 72 65 66 65 72 65 6e | 63 65 73 20 66 6f 6c 64 |Preferen|ces fold|
|00003c50| 65 72 20 2a 2f 0d 09 4f | 70 65 6e 50 72 65 66 65 |er */..O|penPrefe|
|00003c60| 72 65 6e 63 65 73 46 6f | 6c 64 65 72 28 29 3b 0d |rencesFo|lder();.|
|00003c70| 09 73 74 72 65 61 6d 20 | 3d 20 66 6f 70 65 6e 28 |.stream |= fopen(|
|00003c80| 66 69 6c 65 6e 61 6d 65 | 2c 22 61 22 29 3b 0d 09 |filename|,"a");..|
|00003c90| 43 6c 6f 73 65 50 72 65 | 66 65 72 65 6e 63 65 73 |ClosePre|ferences|
|00003ca0| 46 6f 6c 64 65 72 28 29 | 3b 0d 09 69 66 20 28 73 |Folder()|;..if (s|
|00003cb0| 74 72 65 61 6d 20 3d 3d | 20 4e 55 4c 4c 29 0d 09 |tream ==| NULL)..|
|00003cc0| 09 50 72 69 6e 74 66 45 | 78 69 74 28 22 4f 70 65 |.PrintfE|xit("Ope|
|00003cd0| 6e 43 61 6c 46 69 6c 65 | 57 72 69 74 65 3a 20 63 |nCalFile|Write: c|
|00003ce0| 61 6e 6e 6f 74 20 63 72 | 65 61 74 65 20 66 69 6c |annot cr|eate fil|
|00003cf0| 65 20 5c 22 25 73 5c 22 | 20 69 6e 20 50 72 65 66 |e \"%s\"| in Pref|
|00003d00| 65 72 65 6e 63 65 73 20 | 66 6f 6c 64 65 72 2e 22 |erences |folder."|
|00003d10| 2c 66 69 6c 65 6e 61 6d | 65 29 3b 0d 09 72 65 74 |,filenam|e);..ret|
|00003d20| 75 72 6e 28 73 74 72 65 | 61 6d 29 3b 0d 7d 0d 0d |urn(stre|am);.}..|
|00003d30| 2f 2a 0d 52 4f 55 54 49 | 4e 45 3a 20 41 70 70 65 |/*.ROUTI|NE: Appe|
|00003d40| 6e 64 44 65 73 63 72 69 | 70 74 69 6f 6e 73 0d 50 |ndDescri|ptions.P|
|00003d50| 55 52 50 4f 53 45 3a 0d | 09 41 70 70 65 6e 64 73 |URPOSE:.|.Appends|
|00003d60| 20 74 68 65 20 73 65 63 | 6f 6e 64 20 64 65 73 63 | the sec|ond desc|
|00003d70| 72 69 70 74 69 6f 6e 73 | 20 61 72 72 61 79 20 6f |riptions| array o|
|00003d80| 6e 74 6f 20 74 68 65 20 | 65 6e 64 20 6f 66 20 74 |nto the |end of t|
|00003d90| 68 65 20 66 69 72 73 74 | 2c 0d 09 77 68 69 63 68 |he first|,..which|
|00003da0| 20 69 73 20 72 65 61 6c | 6c 6f 63 61 74 65 64 20 | is real|located |
|00003db0| 77 69 74 68 20 6d 6f 72 | 65 20 73 70 61 63 65 2e |with mor|e space.|
|00003dc0| 0d 09 0d 09 54 68 65 20 | 73 6f 75 72 63 65 20 61 |....The |source a|
|00003dd0| 72 72 61 79 20 69 73 20 | 6e 6f 74 20 66 72 65 65 |rray is |not free|
|00003de0| 64 3b 20 74 68 65 20 63 | 61 6c 6c 65 72 20 73 68 |d; the c|aller sh|
|00003df0| 6f 75 6c 64 20 64 6f 20 | 74 68 61 74 2e 0d 2a 2f |ould do |that..*/|
|00003e00| 0d 76 6f 69 64 20 41 70 | 70 65 6e 64 44 65 73 63 |.void Ap|pendDesc|
|00003e10| 72 69 70 74 69 6f 6e 73 | 28 44 65 73 63 72 69 70 |riptions|(Descrip|
|00003e20| 74 69 6f 6e 20 2a 2a 64 | 2c 44 65 73 63 72 69 70 |tion **d|,Descrip|
|00003e30| 74 69 6f 6e 20 2a 73 29 | 0d 7b 0d 09 44 65 73 63 |tion *s)|.{..Desc|
|00003e40| 72 69 70 74 69 6f 6e 20 | 2a 64 54 65 6d 70 3b 0d |ription |*dTemp;.|
|00003e50| 09 6c 6f 6e 67 20 6e 31 | 2c 20 6e 32 2c 20 6e 3b |.long n1|, n2, n;|
|00003e60| 0d 09 0d 09 6e 31 20 3d | 20 4e 75 6d 62 65 72 4f |....n1 =| NumberO|
|00003e70| 66 44 65 73 63 72 69 70 | 74 69 6f 6e 73 28 2a 64 |fDescrip|tions(*d|
|00003e80| 29 3b 0d 09 6e 32 20 3d | 20 4e 75 6d 62 65 72 4f |);..n2 =| NumberO|
|00003e90| 66 44 65 73 63 72 69 70 | 74 69 6f 6e 73 28 73 29 |fDescrip|tions(s)|
|00003ea0| 3b 0d 09 6e 20 3d 20 6e | 31 2b 6e 32 3b 0d 09 64 |;..n = n|1+n2;..d|
|00003eb0| 54 65 6d 70 20 3d 20 41 | 6c 6c 6f 63 61 74 65 44 |Temp = A|llocateD|
|00003ec0| 65 73 63 72 69 70 74 69 | 6f 6e 73 28 6e 29 3b 0d |escripti|ons(n);.|
|00003ed0| 09 43 6f 70 79 44 65 73 | 63 72 69 70 74 69 6f 6e |.CopyDes|cription|
|00003ee0| 73 28 64 54 65 6d 70 2c | 2a 64 29 3b 0d 09 43 6f |s(dTemp,|*d);..Co|
|00003ef0| 70 79 44 65 73 63 72 69 | 70 74 69 6f 6e 73 28 64 |pyDescri|ptions(d|
|00003f00| 54 65 6d 70 2b 6e 31 2c | 73 29 3b 0d 09 46 72 65 |Temp+n1,|s);..Fre|
|00003f10| 65 44 65 73 63 72 69 70 | 74 69 6f 6e 73 28 2a 64 |eDescrip|tions(*d|
|00003f20| 29 3b 0d 09 2a 64 3d 64 | 54 65 6d 70 3b 0d 7d 0d |);..*d=d|Temp;.}.|
|00003f30| 0d 2f 2a 0d 52 4f 55 54 | 49 4e 45 3a 20 43 6f 70 |./*.ROUT|INE: Cop|
|00003f40| 79 44 65 73 63 72 69 70 | 74 69 6f 6e 73 0d 50 55 |yDescrip|tions.PU|
|00003f50| 52 50 4f 53 45 3a 0d 09 | 43 6f 70 79 20 6f 6e 65 |RPOSE:..|Copy one|
|00003f60| 20 6e 75 6c 6c 2d 74 65 | 72 6d 69 6e 61 74 65 64 | null-te|rminated|
|00003f70| 20 61 72 72 61 79 20 6f | 66 20 64 65 73 63 72 69 | array o|f descri|
|00003f80| 70 74 69 6f 6e 73 20 74 | 6f 20 61 6e 6f 74 68 65 |ptions t|o anothe|
|00003f90| 72 2c 20 77 68 69 63 68 | 20 69 73 20 61 73 73 75 |r, which| is assu|
|00003fa0| 6d 65 64 20 74 6f 0d 09 | 62 65 20 62 69 67 20 65 |med to..|be big e|
|00003fb0| 6e 6f 75 67 68 2e 0d 2a | 2f 0d 76 6f 69 64 20 43 |nough..*|/.void C|
|00003fc0| 6f 70 79 44 65 73 63 72 | 69 70 74 69 6f 6e 73 28 |opyDescr|iptions(|
|00003fd0| 44 65 73 63 72 69 70 74 | 69 6f 6e 20 2a 64 2c 44 |Descript|ion *d,D|
|00003fe0| 65 73 63 72 69 70 74 69 | 6f 6e 20 2a 73 29 0d 7b |escripti|on *s).{|
|00003ff0| 0d 09 6c 6f 6e 67 20 69 | 20 3d 20 30 3b 0d 09 0d |..long i| = 0;...|
|00004000| 09 77 68 69 6c 65 20 28 | 20 21 49 73 4e 75 6c 6c |.while (| !IsNull|
|00004010| 44 65 73 63 72 69 70 74 | 69 6f 6e 28 73 5b 69 5d |Descript|ion(s[i]|
|00004020| 29 20 29 20 7b 0d 09 09 | 64 5b 69 5d 3d 73 5b 69 |) ) {...|d[i]=s[i|
|00004030| 5d 3b 0d 09 09 69 2b 2b | 3b 0d 09 7d 0d 09 64 5b |];...i++|;..}..d[|
|00004040| 69 5d 3d 4e 75 6c 6c 44 | 65 73 63 72 69 70 74 69 |i]=NullD|escripti|
|00004050| 6f 6e 28 29 3b 0d 7d 0d | 0d 2f 2a 0d 52 4f 55 54 |on();.}.|./*.ROUT|
|00004060| 49 4e 45 3a 20 41 6c 6c | 6f 63 61 74 65 44 65 73 |INE: All|ocateDes|
|00004070| 63 72 69 70 74 69 6f 6e | 73 0d 50 55 52 50 4f 53 |cription|s.PURPOS|
|00004080| 45 3a 0d 09 41 6c 6c 6f | 63 61 74 65 20 73 70 61 |E:..Allo|cate spa|
|00004090| 63 65 20 66 6f 72 20 76 | 61 72 69 61 62 6c 65 20 |ce for v|ariable |
|000040a0| 64 65 73 63 72 69 70 74 | 69 6f 6e 73 2e 0d 09 41 |descript|ions...A|
|000040b0| 64 64 73 20 6f 6e 65 20 | 74 6f 20 74 68 65 20 70 |dds one |to the p|
|000040c0| 61 73 73 65 64 20 73 69 | 7a 65 20 74 6f 20 61 6c |assed si|ze to al|
|000040d0| 6c 6f 77 20 75 73 65 20 | 6f 66 20 6e 75 6c 6c 20 |low use |of null |
|000040e0| 65 6c 65 6d 65 6e 74 20 | 61 73 20 65 6e 64 20 6d |element |as end m|
|000040f0| 61 72 6b 65 72 2e 0d 09 | 4e 75 6c 6c 73 20 61 6c |arker...|Nulls al|
|00004100| 6c 20 74 68 65 20 65 6c | 65 6d 65 6e 74 73 2e 0d |l the el|ements..|
|00004110| 2a 2f 0d 44 65 73 63 72 | 69 70 74 69 6f 6e 20 2a |*/.Descr|iption *|
|00004120| 41 6c 6c 6f 63 61 74 65 | 44 65 73 63 72 69 70 74 |Allocate|Descript|
|00004130| 69 6f 6e 73 28 6c 6f 6e | 67 20 6e 29 0d 7b 0d 09 |ions(lon|g n).{..|
|00004140| 44 65 73 63 72 69 70 74 | 69 6f 6e 20 2a 64 3b 0d |Descript|ion *d;.|
|00004150| 0d 09 64 20 3d 20 63 61 | 6c 6c 6f 63 28 6e 2b 31 |..d = ca|lloc(n+1|
|00004160| 2c 73 69 7a 65 6f 66 28 | 44 65 73 63 72 69 70 74 |,sizeof(|Descript|
|00004170| 69 6f 6e 29 29 3b 0d 09 | 69 66 28 64 20 3d 3d 20 |ion));..|if(d == |
|00004180| 4e 55 4c 4c 29 50 72 69 | 6e 74 66 45 78 69 74 28 |NULL)Pri|ntfExit(|
|00004190| 22 41 6c 6c 6f 63 61 74 | 65 44 65 73 63 72 69 70 |"Allocat|eDescrip|
|000041a0| 74 69 6f 6e 3a 20 6d 65 | 6d 6f 72 79 20 61 6c 6c |tion: me|mory all|
|000041b0| 6f 63 61 74 69 6f 6e 20 | 66 61 69 6c 75 72 65 2e |ocation |failure.|
|000041c0| 22 29 3b 0d 09 64 5b 30 | 5d 3d 4e 75 6c 6c 44 65 |");..d[0|]=NullDe|
|000041d0| 73 63 72 69 70 74 69 6f | 6e 28 29 3b 0d 09 66 6f |scriptio|n();..fo|
|000041e0| 72 28 3b 6e 3e 30 3b 6e | 2d 2d 29 64 5b 6e 5d 3d |r(;n>0;n|--)d[n]=|
|000041f0| 64 5b 30 5d 3b 0d 09 72 | 65 74 75 72 6e 28 64 29 |d[0];..r|eturn(d)|
|00004200| 3b 0d 7d 0d 0d 0d 2f 2a | 0d 52 4f 55 54 49 4e 45 |;.}.../*|.ROUTINE|
|00004210| 3a 20 46 72 65 65 44 65 | 73 63 72 69 70 74 69 6f |: FreeDe|scriptio|
|00004220| 6e 73 0d 50 55 52 50 4f | 53 45 3a 0d 09 46 72 65 |ns.PURPO|SE:..Fre|
|00004230| 65 20 74 68 65 20 64 65 | 73 63 72 69 70 74 69 6f |e the de|scriptio|
|00004240| 6e 20 73 70 61 63 65 2e | 20 20 44 6f 65 73 20 6e |n space.| Does n|
|00004250| 6f 74 20 61 66 66 65 63 | 74 20 74 68 65 20 64 65 |ot affec|t the de|
|00004260| 73 63 72 69 62 65 64 20 | 76 61 72 69 61 62 6c 65 |scribed |variable|
|00004270| 73 0d 09 74 68 65 6d 73 | 65 6c 76 65 73 2e 0d 2a |s..thems|elves..*|
|00004280| 2f 0d 76 6f 69 64 20 46 | 72 65 65 44 65 73 63 72 |/.void F|reeDescr|
|00004290| 69 70 74 69 6f 6e 73 28 | 44 65 73 63 72 69 70 74 |iptions(|Descript|
|000042a0| 69 6f 6e 20 2a 64 29 0d | 7b 0d 09 66 72 65 65 28 |ion *d).|{..free(|
|000042b0| 64 29 3b 09 0d 7d 0d 0d | 2f 2a 0d 52 4f 55 54 49 |d);..}..|/*.ROUTI|
|000042c0| 4e 45 3a 20 4e 75 6d 62 | 65 72 4f 66 44 65 73 63 |NE: Numb|erOfDesc|
|000042d0| 72 69 70 74 69 6f 6e 73 | 0d 50 55 52 50 4f 53 45 |riptions|.PURPOSE|
|000042e0| 3a 0d 09 46 69 6e 64 20 | 74 68 65 20 73 69 7a 65 |:..Find |the size|
|000042f0| 20 6f 66 20 61 6e 20 61 | 72 72 61 79 20 6f 66 20 | of an a|rray of |
|00004300| 64 65 73 63 72 69 70 74 | 69 6f 6e 73 2e 0d 09 0d |descript|ions....|
|00004310| 09 44 6f 65 73 20 6e 6f | 74 20 63 6f 75 6e 74 20 |.Does no|t count |
|00004320| 74 68 65 20 74 72 61 69 | 6c 69 6e 67 20 6e 75 6c |the trai|ling nul|
|00004330| 6c 20 64 65 73 63 72 69 | 70 74 69 6f 6e 2e 0d 2a |l descri|ption..*|
|00004340| 2f 0d 6c 6f 6e 67 20 4e | 75 6d 62 65 72 4f 66 44 |/.long N|umberOfD|
|00004350| 65 73 63 72 69 70 74 69 | 6f 6e 73 28 44 65 73 63 |escripti|ons(Desc|
|00004360| 72 69 70 74 69 6f 6e 20 | 2a 64 29 0d 7b 0d 09 6c |ription |*d).{..l|
|00004370| 6f 6e 67 20 69 3d 30 3b | 0d 09 0d 09 77 68 69 6c |ong i=0;|....whil|
|00004380| 65 20 28 20 21 49 73 4e | 75 6c 6c 44 65 73 63 72 |e ( !IsN|ullDescr|
|00004390| 69 70 74 69 6f 6e 28 64 | 5b 69 5d 29 20 29 20 69 |iption(d|[i]) ) i|
|000043a0| 2b 2b 3b 0d 09 72 65 74 | 75 72 6e 28 69 29 3b 0d |++;..ret|urn(i);.|
|000043b0| 7d 0d 0d 2f 2a 0d 52 4f | 55 54 49 4e 45 3a 20 4e |}../*.RO|UTINE: N|
|000043c0| 75 6c 6c 44 65 73 63 72 | 69 70 74 69 6f 6e 0d 50 |ullDescr|iption.P|
|000043d0| 55 52 50 4f 53 45 3a 0d | 09 52 65 74 75 72 6e 73 |URPOSE:.|.Returns|
|000043e0| 20 61 20 6e 75 6c 6c 20 | 64 65 73 63 72 69 70 74 | a null |descript|
|000043f0| 69 6f 6e 2e 0d 09 53 74 | 61 6e 64 61 72 64 20 43 |ion...St|andard C|
|00004400| 20 73 70 65 63 69 66 69 | 65 73 20 74 68 61 74 20 | specifi|es that |
|00004410| 73 74 61 74 69 63 20 76 | 61 72 69 61 62 6c 65 73 |static v|ariables|
|00004420| 20 61 72 65 20 69 6e 69 | 74 69 61 6c 69 7a 65 64 | are ini|tialized|
|00004430| 20 74 6f 20 7a 65 72 6f | 2e 0d 2a 2f 0d 44 65 73 | to zero|..*/.Des|
|00004440| 63 72 69 70 74 69 6f 6e | 20 4e 75 6c 6c 44 65 73 |cription| NullDes|
|00004450| 63 72 69 70 74 69 6f 6e | 28 76 6f 69 64 29 0d 7b |cription|(void).{|
|00004460| 0d 09 73 74 61 74 69 63 | 20 44 65 73 63 72 69 70 |..static| Descrip|
|00004470| 74 69 6f 6e 20 64 3b 0d | 09 72 65 74 75 72 6e 20 |tion d;.|.return |
|00004480| 64 3b 0d 7d 0d 0d 44 65 | 73 63 72 69 70 74 69 6f |d;.}..De|scriptio|
|00004490| 6e 20 44 65 73 63 72 69 | 62 65 28 73 68 6f 72 74 |n Descri|be(short|
|000044a0| 20 74 79 70 65 2c 76 6f | 69 64 20 2a 70 74 72 2c | type,vo|id *ptr,|
|000044b0| 63 68 61 72 20 2a 6e 61 | 6d 65 2c 63 6f 6e 73 74 |char *na|me,const|
|000044c0| 20 63 68 61 72 20 2a 63 | 6f 6d 6d 65 6e 74 29 0d | char *c|omment).|
|000044d0| 7b 0d 09 73 74 61 74 69 | 63 20 44 65 73 63 72 69 |{..stati|c Descri|
|000044e0| 70 74 69 6f 6e 20 76 61 | 72 3b 0d 0d 09 76 61 72 |ption va|r;...var|
|000044f0| 3d 44 65 73 63 72 69 62 | 65 41 72 72 61 79 28 74 |=Describ|eArray(t|
|00004500| 79 70 65 2c 70 74 72 2c | 6e 61 6d 65 2c 63 6f 6d |ype,ptr,|name,com|
|00004510| 6d 65 6e 74 2c 30 4c 29 | 3b 0d 09 69 66 28 49 73 |ment,0L)|;..if(Is|
|00004520| 50 74 72 28 74 79 70 65 | 29 29 20 76 61 72 2e 73 |Ptr(type|)) var.s|
|00004530| 69 7a 65 64 4f 6e 63 65 | 3d 76 61 72 2e 73 69 7a |izedOnce|=var.siz|
|00004540| 65 64 3d 30 3b 0d 09 72 | 65 74 75 72 6e 20 76 61 |ed=0;..r|eturn va|
|00004550| 72 3b 0d 7d 0d 0d 44 65 | 73 63 72 69 70 74 69 6f |r;.}..De|scriptio|
|00004560| 6e 20 44 65 73 63 72 69 | 62 65 41 72 72 61 79 28 |n Descri|beArray(|
|00004570| 73 68 6f 72 74 20 74 79 | 70 65 2c 76 6f 69 64 20 |short ty|pe,void |
|00004580| 2a 70 74 72 2c 63 68 61 | 72 20 2a 6e 61 6d 65 2c |*ptr,cha|r *name,|
|00004590| 63 6f 6e 73 74 20 63 68 | 61 72 20 2a 63 6f 6d 6d |const ch|ar *comm|
|000045a0| 65 6e 74 2c 2e 2e 2e 29 | 0d 2f 2a 20 57 41 52 4e |ent,...)|./* WARN|
|000045b0| 49 4e 47 3a 20 74 68 65 | 20 64 69 6d 65 6e 73 69 |ING: the| dimensi|
|000045c0| 6f 6e 73 20 6d 75 73 74 | 20 62 65 20 28 6c 6f 6e |ons must| be (lon|
|000045d0| 67 29 20 61 6e 64 20 74 | 68 65 20 6c 61 73 74 20 |g) and t|he last |
|000045e0| 61 72 67 75 6d 65 6e 74 | 20 6d 75 73 74 20 62 65 |argument| must be|
|000045f0| 20 30 4c 2e 20 2a 2f 0d | 7b 0d 09 76 61 5f 6c 69 | 0L. */.|{..va_li|
|00004600| 73 74 20 61 72 67 73 3b | 0d 09 73 74 61 74 69 63 |st args;|..static|
|00004610| 20 44 65 73 63 72 69 70 | 74 69 6f 6e 20 76 61 72 | Descrip|tion var|
|00004620| 3b 0d 09 69 6e 74 20 69 | 3b 0d 09 6c 6f 6e 67 20 |;..int i|;..long |
|00004630| 64 69 6d 3b 0d 09 0d 09 | 76 61 72 2e 6e 61 6d 65 |dim;....|var.name|
|00004640| 3d 6e 61 6d 65 3b 0d 09 | 76 61 72 2e 70 74 72 3d |=name;..|var.ptr=|
|00004650| 70 74 72 3b 0d 09 76 61 | 72 2e 74 79 70 65 3d 74 |ptr;..va|r.type=t|
|00004660| 79 70 65 3b 0d 09 76 61 | 72 2e 66 69 72 73 74 45 |ype;..va|r.firstE|
|00004670| 6c 65 6d 65 6e 74 3d 30 | 3b 0d 09 66 6f 72 28 69 |lement=0|;..for(i|
|00004680| 3d 30 3b 69 3c 41 53 53 | 49 47 4e 5f 44 49 4d 53 |=0;i<ASS|IGN_DIMS|
|00004690| 3b 69 2b 2b 29 76 61 72 | 2e 64 69 6d 5b 69 5d 3d |;i++)var|.dim[i]=|
|000046a0| 30 3b 0d 09 76 61 72 2e | 63 6f 6d 6d 65 6e 74 3d |0;..var.|comment=|
|000046b0| 63 6f 6d 6d 65 6e 74 3b | 0d 09 76 61 5f 73 74 61 |comment;|..va_sta|
|000046c0| 72 74 28 61 72 67 73 2c | 63 6f 6d 6d 65 6e 74 29 |rt(args,|comment)|
|000046d0| 3b 0d 09 66 6f 72 28 69 | 3d 30 3b 3b 69 2b 2b 29 |;..for(i|=0;;i++)|
|000046e0| 7b 0d 09 09 64 69 6d 3d | 76 61 5f 61 72 67 28 61 |{...dim=|va_arg(a|
|000046f0| 72 67 73 2c 6c 6f 6e 67 | 29 3b 0d 09 09 69 66 28 |rgs,long|);...if(|
|00004700| 64 69 6d 3d 3d 30 29 62 | 72 65 61 6b 3b 0d 09 09 |dim==0)b|reak;...|
|00004710| 69 66 28 69 3e 3d 41 53 | 53 49 47 4e 5f 44 49 4d |if(i>=AS|SIGN_DIM|
|00004720| 53 29 50 72 69 6e 74 66 | 45 78 69 74 28 22 44 65 |S)Printf|Exit("De|
|00004730| 73 63 72 69 62 65 2f 41 | 72 72 61 79 2f 46 69 72 |scribe/A|rray/Fir|
|00004740| 73 74 4c 61 73 74 3a 20 | 22 0d 09 09 09 22 74 6f |stLast: |"...."to|
|00004750| 6f 20 6d 61 6e 79 20 64 | 69 6d 65 6e 73 69 6f 6e |o many d|imension|
|00004760| 73 20 28 6f 72 20 6d 69 | 73 73 69 6e 67 20 66 69 |s (or mi|ssing fi|
|00004770| 6e 61 6c 20 30 4c 29 20 | 66 6f 72 20 5c 22 25 73 |nal 0L) |for \"%s|
|00004780| 5c 22 2e 5c 6e 22 2c 76 | 61 72 2e 6e 61 6d 65 29 |\".\n",v|ar.name)|
|00004790| 3b 0d 09 09 76 61 72 2e | 64 69 6d 5b 69 5d 3d 64 |;...var.|dim[i]=d|
|000047a0| 69 6d 3b 0d 09 7d 0d 09 | 76 61 5f 65 6e 64 28 61 |im;..}..|va_end(a|
|000047b0| 72 67 73 29 3b 0d 09 69 | 66 28 76 61 72 2e 74 79 |rgs);..i|f(var.ty|
|000047c0| 70 65 21 3d 30 20 26 26 | 20 76 61 72 2e 70 74 72 |pe!=0 &&| var.ptr|
|000047d0| 3d 3d 4e 55 4c 4c 29 0d | 09 09 50 72 69 6e 74 66 |==NULL).|..Printf|
|000047e0| 45 78 69 74 28 22 44 65 | 73 63 72 69 62 65 2f 41 |Exit("De|scribe/A|
|000047f0| 72 72 61 79 2f 46 69 72 | 73 74 4c 61 73 74 3a 20 |rray/Fir|stLast: |
|00004800| 5c 22 25 73 5c 22 20 70 | 74 72 20 69 73 20 4e 55 |\"%s\" p|tr is NU|
|00004810| 4c 4c 2e 5c 6e 22 2c 76 | 61 72 2e 6e 61 6d 65 29 |LL.\n",v|ar.name)|
|00004820| 3b 0d 09 2f 2a 20 4e 6f | 74 65 3a 20 77 65 27 72 |;../* No|te: we'r|
|00004830| 65 20 63 6c 65 61 72 69 | 6e 67 20 74 68 65 20 6d |e cleari|ng the m|
|00004840| 61 6c 6c 6f 63 65 64 20 | 66 6c 61 67 2c 20 77 68 |alloced |flag, wh|
|00004850| 69 63 68 20 69 73 20 74 | 68 65 20 6f 6e 6c 79 20 |ich is t|he only |
|00004860| 73 61 66 65 20 61 73 73 | 75 6d 70 74 69 6f 6e 2e |safe ass|umption.|
|00004870| 20 2a 2f 0d 09 76 61 72 | 2e 6d 61 6c 6c 6f 63 65 | */..var|.malloce|
|00004880| 64 3d 30 3b 0d 09 76 61 | 72 2e 73 69 7a 65 64 4f |d=0;..va|r.sizedO|
|00004890| 6e 63 65 3d 76 61 72 2e | 73 69 7a 65 64 3d 31 3b |nce=var.|sized=1;|
|000048a0| 0d 09 72 65 74 75 72 6e | 20 76 61 72 3b 0d 7d 0d |..return| var;.}.|
|000048b0| 44 65 73 63 72 69 70 74 | 69 6f 6e 20 44 65 73 63 |Descript|ion Desc|
|000048c0| 72 69 62 65 46 69 72 73 | 74 4c 61 73 74 28 73 68 |ribeFirs|tLast(sh|
|000048d0| 6f 72 74 20 74 79 70 65 | 2c 76 6f 69 64 20 2a 70 |ort type|,void *p|
|000048e0| 74 72 2c 63 68 61 72 20 | 2a 6e 61 6d 65 0d 09 2c |tr,char |*name..,|
|000048f0| 63 6f 6e 73 74 20 63 68 | 61 72 20 2a 63 6f 6d 6d |const ch|ar *comm|
|00004900| 65 6e 74 2c 6c 6f 6e 67 | 20 66 69 72 73 74 45 6c |ent,long| firstEl|
|00004910| 65 6d 65 6e 74 2c 6c 6f | 6e 67 20 6c 61 73 74 45 |ement,lo|ng lastE|
|00004920| 6c 65 6d 65 6e 74 29 0d | 7b 0d 09 73 74 61 74 69 |lement).|{..stati|
|00004930| 63 20 44 65 73 63 72 69 | 70 74 69 6f 6e 20 76 61 |c Descri|ption va|
|00004940| 72 3b 0d 09 6c 6f 6e 67 | 20 64 69 6d 3b 0d 09 0d |r;..long| dim;...|
|00004950| 09 64 69 6d 3d 31 2b 6c | 61 73 74 45 6c 65 6d 65 |.dim=1+l|astEleme|
|00004960| 6e 74 2d 66 69 72 73 74 | 45 6c 65 6d 65 6e 74 3b |nt-first|Element;|
|00004970| 0d 09 76 61 72 3d 44 65 | 73 63 72 69 62 65 41 72 |..var=De|scribeAr|
|00004980| 72 61 79 28 74 79 70 65 | 2c 70 74 72 2c 6e 61 6d |ray(type|,ptr,nam|
|00004990| 65 2c 63 6f 6d 6d 65 6e | 74 2c 64 69 6d 2c 30 4c |e,commen|t,dim,0L|
|000049a0| 29 3b 0d 09 76 61 72 2e | 66 69 72 73 74 45 6c 65 |);..var.|firstEle|
|000049b0| 6d 65 6e 74 3d 66 69 72 | 73 74 45 6c 65 6d 65 6e |ment=fir|stElemen|
|000049c0| 74 3b 0d 09 72 65 74 75 | 72 6e 20 76 61 72 3b 0d |t;..retu|rn var;.|
|000049d0| 7d 0d 44 65 73 63 72 69 | 70 74 69 6f 6e 20 53 65 |}.Descri|ption Se|
|000049e0| 74 41 56 61 72 69 61 62 | 6c 65 28 73 68 6f 72 74 |tAVariab|le(short|
|000049f0| 20 74 79 70 65 2c 76 6f | 69 64 20 2a 70 74 72 2c | type,vo|id *ptr,|
|00004a00| 63 68 61 72 20 2a 6e 61 | 6d 65 2c 75 6e 73 69 67 |char *na|me,unsig|
|00004a10| 6e 65 64 20 6c 6f 6e 67 | 20 64 69 6d 0d 09 2c 63 |ned long| dim..,c|
|00004a20| 6f 6e 73 74 20 63 68 61 | 72 20 2a 63 6f 6d 6d 65 |onst cha|r *comme|
|00004a30| 6e 74 29 0d 2f 2a 20 4f | 6c 64 20 73 74 79 6c 65 |nt)./* O|ld style|
|00004a40| 2c 20 72 65 74 61 69 6e | 65 64 20 73 6f 6c 65 6c |, retain|ed solel|
|00004a50| 79 20 66 6f 72 20 63 6f | 6d 70 61 74 69 62 69 6c |y for co|mpatibil|
|00004a60| 69 74 79 20 2a 2f 0d 7b | 0d 09 69 66 28 64 69 6d |ity */.{|..if(dim|
|00004a70| 3d 3d 30 29 72 65 74 75 | 72 6e 20 44 65 73 63 72 |==0)retu|rn Descr|
|00004a80| 69 62 65 28 74 79 70 65 | 2c 70 74 72 2c 6e 61 6d |ibe(type|,ptr,nam|
|00004a90| 65 2c 63 6f 6d 6d 65 6e | 74 29 3b 0d 09 65 6c 73 |e,commen|t);..els|
|00004aa0| 65 20 72 65 74 75 72 6e | 20 44 65 73 63 72 69 62 |e return| Describ|
|00004ab0| 65 41 72 72 61 79 28 74 | 79 70 65 2c 70 74 72 2c |eArray(t|ype,ptr,|
|00004ac0| 6e 61 6d 65 2c 63 6f 6d | 6d 65 6e 74 2c 64 69 6d |name,com|ment,dim|
|00004ad0| 2c 30 4c 29 3b 0d 7d 0d | 69 6e 74 20 41 6c 6c 6f |,0L);.}.|int Allo|
|00004ae0| 63 61 74 65 44 65 73 63 | 72 69 62 65 64 50 74 72 |cateDesc|ribedPtr|
|00004af0| 56 61 72 73 28 44 65 73 | 63 72 69 70 74 69 6f 6e |Vars(Des|cription|
|00004b00| 20 64 65 73 63 72 69 70 | 74 69 6f 6e 5b 5d 2c 63 | descrip|tion[],c|
|00004b10| 6f 6e 73 74 20 63 68 61 | 72 20 2a 68 65 72 65 2c |onst cha|r *here,|
|00004b20| 73 68 6f 72 74 20 66 6c | 61 67 73 29 0d 7b 0d 09 |short fl|ags).{..|
|00004b30| 72 65 67 69 73 74 65 72 | 20 44 65 73 63 72 69 70 |register| Descrip|
|00004b40| 74 69 6f 6e 20 2a 64 3b | 0d 09 0d 09 66 6f 72 28 |tion *d;|....for(|
|00004b50| 64 3d 64 65 73 63 72 69 | 70 74 69 6f 6e 3b 64 2d |d=descri|ption;d-|
|00004b60| 3e 74 79 70 65 21 3d 30 | 3b 64 2b 2b 29 7b 0d 09 |>type!=0|;d++){..|
|00004b70| 09 69 66 28 49 73 50 74 | 72 28 64 2d 3e 74 79 70 |.if(IsPt|r(d->typ|
|00004b80| 65 29 20 26 26 20 64 2d | 3e 73 69 7a 65 64 4f 6e |e) && d-|>sizedOn|
|00004b90| 63 65 20 26 26 20 21 64 | 2d 3e 6d 61 6c 6c 6f 63 |ce && !d|->malloc|
|00004ba0| 65 64 29 7b 0d 09 09 09 | 61 73 73 65 72 74 28 64 |ed){....|assert(d|
|00004bb0| 2d 3e 70 74 72 21 3d 4e | 55 4c 4c 29 3b 0d 09 09 |->ptr!=N|ULL);...|
|00004bc0| 09 2a 28 76 6f 69 64 20 | 2a 2a 29 64 2d 3e 70 74 |.*(void |**)d->pt|
|00004bd0| 72 3d 6d 61 6c 6c 6f 63 | 28 45 6c 65 6d 65 6e 74 |r=malloc|(Element|
|00004be0| 73 28 64 29 2a 74 79 70 | 65 53 69 7a 65 5b 64 2d |s(d)*typ|eSize[d-|
|00004bf0| 3e 74 79 70 65 5d 29 3b | 0d 09 09 09 69 66 28 2a |>type]);|....if(*|
|00004c00| 28 76 6f 69 64 20 2a 2a | 29 64 2d 3e 70 74 72 3d |(void **|)d->ptr=|
|00004c10| 3d 4e 55 4c 4c 29 7b 0d | 09 09 09 09 69 66 28 50 |=NULL){.|....if(P|
|00004c20| 52 49 4e 54 46 5f 45 58 | 49 54 29 50 72 69 6e 74 |RINTF_EX|IT)Print|
|00004c30| 66 45 78 69 74 28 22 25 | 73 3a 20 6e 6f 20 72 6f |fExit("%|s: no ro|
|00004c40| 6f 6d 20 66 6f 72 20 25 | 6c 64 20 62 79 74 65 73 |om for %|ld bytes|
|00004c50| 20 66 6f 72 20 5c 22 25 | 73 5c 22 2e 5c 6e 22 0d | for \"%|s\".\n".|
|00004c60| 09 09 09 09 09 2c 68 65 | 72 65 2c 45 6c 65 6d 65 |.....,he|re,Eleme|
|00004c70| 6e 74 73 28 64 29 2a 74 | 79 70 65 53 69 7a 65 5b |nts(d)*t|ypeSize[|
|00004c80| 64 2d 3e 74 79 70 65 5d | 2c 64 2d 3e 6e 61 6d 65 |d->type]|,d->name|
|00004c90| 29 3b 0d 09 09 09 09 65 | 6c 73 65 20 72 65 74 75 |);.....e|lse retu|
|00004ca0| 72 6e 20 61 73 73 69 67 | 6e 4d 65 6d 6f 72 79 45 |rn assig|nMemoryE|
|00004cb0| 72 72 6f 72 3b 0d 09 09 | 09 7d 0d 09 09 09 64 2d |rror;...|.}....d-|
|00004cc0| 3e 73 69 7a 65 64 3d 64 | 2d 3e 6d 61 6c 6c 6f 63 |>sized=d|->malloc|
|00004cd0| 65 64 3d 31 3b 0d 09 09 | 09 49 6e 69 74 69 61 6c |ed=1;...|.Initial|
|00004ce0| 69 7a 65 41 44 65 73 63 | 72 69 62 65 64 56 61 72 |izeADesc|ribedVar|
|00004cf0| 28 64 2c 66 6c 61 67 73 | 29 3b 0d 09 09 7d 0d 09 |(d,flags|);...}..|
|00004d00| 7d 0d 09 72 65 74 75 72 | 6e 20 30 3b 0d 7d 0d 0d |}..retur|n 0;.}..|
|00004d10| 6c 6f 6e 67 20 43 68 65 | 63 6b 44 65 73 63 72 69 |long Che|ckDescri|
|00004d20| 70 74 69 6f 6e 73 28 44 | 65 73 63 72 69 70 74 69 |ptions(D|escripti|
|00004d30| 6f 6e 20 64 5b 5d 2c 63 | 6f 6e 73 74 20 63 68 61 |on d[],c|onst cha|
|00004d40| 72 20 2a 68 65 72 65 2c | 73 68 6f 72 74 20 66 6c |r *here,|short fl|
|00004d50| 61 67 73 29 0d 7b 0d 09 | 69 6e 74 20 65 72 72 6f |ags).{..|int erro|
|00004d60| 72 3b 0d 09 0d 09 69 66 | 28 66 6c 61 67 73 26 61 |r;....if|(flags&a|
|00004d70| 73 73 69 67 6e 41 6c 72 | 65 61 64 79 43 68 65 63 |ssignAlr|eadyChec|
|00004d80| 6b 65 64 29 72 65 74 75 | 72 6e 20 30 3b 0d 09 66 |ked)retu|rn 0;..f|
|00004d90| 6f 72 28 3b 64 2d 3e 74 | 79 70 65 21 3d 30 3b 64 |or(;d->t|ype!=0;d|
|00004da0| 2b 2b 29 7b 0d 09 09 65 | 72 72 6f 72 3d 43 68 65 |++){...e|rror=Che|
|00004db0| 63 6b 41 44 65 73 63 72 | 69 70 74 69 6f 6e 28 64 |ckADescr|iption(d|
|00004dc0| 2c 68 65 72 65 2c 66 6c | 61 67 73 29 3b 0d 09 09 |,here,fl|ags);...|
|00004dd0| 69 66 28 65 72 72 6f 72 | 29 72 65 74 75 72 6e 20 |if(error|)return |
|00004de0| 65 72 72 6f 72 3b 0d 09 | 7d 0d 09 72 65 74 75 72 |error;..|}..retur|
|00004df0| 6e 20 30 3b 0d 7d 0d 0d | 6c 6f 6e 67 20 43 68 65 |n 0;.}..|long Che|
|00004e00| 63 6b 41 44 65 73 63 72 | 69 70 74 69 6f 6e 28 44 |ckADescr|iption(D|
|00004e10| 65 73 63 72 69 70 74 69 | 6f 6e 20 2a 64 2c 63 6f |escripti|on *d,co|
|00004e20| 6e 73 74 20 63 68 61 72 | 20 2a 68 65 72 65 2c 73 |nst char| *here,s|
|00004e30| 68 6f 72 74 20 66 6c 61 | 67 73 29 0d 7b 0d 09 63 |hort fla|gs).{..c|
|00004e40| 68 61 72 20 2a 73 2c 2a | 73 4f 6b 3b 0d 09 0d 09 |har *s,*|sOk;....|
|00004e50| 69 66 28 66 6c 61 67 73 | 26 61 73 73 69 67 6e 41 |if(flags|&assignA|
|00004e60| 6c 72 65 61 64 79 43 68 | 65 63 6b 65 64 29 72 65 |lreadyCh|ecked)re|
|00004e70| 74 75 72 6e 20 30 3b 0d | 09 69 66 28 64 2d 3e 74 |turn 0;.|.if(d->t|
|00004e80| 79 70 65 3c 3d 30 20 7c | 7c 20 64 2d 3e 74 79 70 |ype<=0 ||| d->typ|
|00004e90| 65 3e 3d 75 6e 6b 6e 6f | 77 6e 54 79 70 65 29 7b |e>=unkno|wnType){|
|00004ea0| 0d 09 09 69 66 28 50 52 | 49 4e 54 46 5f 45 58 49 |...if(PR|INTF_EXI|
|00004eb0| 54 29 50 72 69 6e 74 66 | 45 78 69 74 28 22 25 73 |T)Printf|Exit("%s|
|00004ec0| 3a 20 5c 22 25 73 5c 22 | 20 68 61 73 20 75 6e 6b |: \"%s\"| has unk|
|00004ed0| 6e 6f 77 6e 20 74 79 70 | 65 20 25 6c 64 2e 5c 6e |nown typ|e %ld.\n|
|00004ee0| 22 0d 09 09 09 2c 68 65 | 72 65 2c 64 2d 3e 6e 61 |"....,he|re,d->na|
|00004ef0| 6d 65 2c 28 6c 6f 6e 67 | 29 64 2d 3e 74 79 70 65 |me,(long|)d->type|
|00004f00| 29 3b 0d 09 09 65 6c 73 | 65 20 72 65 74 75 72 6e |);...els|e return|
|00004f10| 20 61 73 73 69 67 6e 56 | 61 72 69 61 62 6c 65 45 | assignV|ariableE|
|00004f20| 72 72 6f 72 3b 0d 09 7d | 0d 09 69 66 28 21 49 73 |rror;..}|..if(!Is|
|00004f30| 50 74 72 28 64 2d 3e 74 | 79 70 65 29 20 26 26 20 |Ptr(d->t|ype) && |
|00004f40| 64 2d 3e 70 74 72 3d 3d | 4e 55 4c 4c 29 7b 0d 09 |d->ptr==|NULL){..|
|00004f50| 09 69 66 28 50 52 49 4e | 54 46 5f 45 58 49 54 29 |.if(PRIN|TF_EXIT)|
|00004f60| 50 72 69 6e 74 66 45 78 | 69 74 28 22 25 73 3a 20 |PrintfEx|it("%s: |
|00004f70| 5c 22 25 73 5c 22 20 70 | 74 72 20 69 73 20 4e 55 |\"%s\" p|tr is NU|
|00004f80| 4c 4c 2e 5c 6e 22 0d 09 | 09 09 2c 68 65 72 65 2c |LL.\n"..|..,here,|
|00004f90| 64 2d 3e 6e 61 6d 65 29 | 3b 0d 09 09 65 6c 73 65 |d->name)|;...else|
|00004fa0| 20 72 65 74 75 72 6e 20 | 61 73 73 69 67 6e 56 61 | return |assignVa|
|00004fb0| 72 69 61 62 6c 65 45 72 | 72 6f 72 3b 0d 09 7d 0d |riableEr|ror;..}.|
|00004fc0| 09 2f 2a 20 53 71 75 65 | 65 7a 65 20 61 6e 79 20 |./* Sque|eze any |
|00004fd0| 73 70 61 63 65 20 6f 75 | 74 20 6f 66 20 74 68 65 |space ou|t of the|
|00004fe0| 20 6e 61 6d 65 20 2a 2f | 0d 09 66 6f 72 28 73 3d | name */|..for(s=|
|00004ff0| 73 4f 6b 3d 64 2d 3e 6e | 61 6d 65 3b 2a 73 21 3d |sOk=d->n|ame;*s!=|
|00005000| 30 3b 73 2b 2b 29 69 66 | 28 21 69 73 73 70 61 63 |0;s++)if|(!isspac|
|00005010| 65 28 2a 73 29 29 2a 73 | 4f 6b 2b 2b 3d 2a 73 3b |e(*s))*s|Ok++=*s;|
|00005020| 0d 09 2a 73 4f 6b 3d 30 | 3b 0d 09 2f 2a 20 43 68 |..*sOk=0|;../* Ch|
|00005030| 65 63 6b 20 6e 61 6d 65 | 27 73 20 73 79 6e 74 61 |eck name|'s synta|
|00005040| 78 20 2a 2f 0d 09 73 3d | 64 2d 3e 6e 61 6d 65 3b |x */..s=|d->name;|
|00005050| 0d 09 69 66 28 50 61 72 | 73 65 4e 61 6d 65 28 26 |..if(Par|seName(&|
|00005060| 73 29 20 7c 7c 20 2a 73 | 21 3d 30 29 7b 0d 09 09 |s) || *s|!=0){...|
|00005070| 69 66 28 50 52 49 4e 54 | 46 5f 45 58 49 54 29 50 |if(PRINT|F_EXIT)P|
|00005080| 72 69 6e 74 66 45 78 69 | 74 28 22 25 73 3a 20 69 |rintfExi|t("%s: i|
|00005090| 6c 6c 65 67 61 6c 20 6e | 61 6d 65 20 5c 22 25 73 |llegal n|ame \"%s|
|000050a0| 5c 22 2e 5c 6e 22 0d 09 | 09 09 2c 68 65 72 65 2c |\".\n"..|..,here,|
|000050b0| 64 2d 3e 6e 61 6d 65 29 | 3b 0d 09 09 65 6c 73 65 |d->name)|;...else|
|000050c0| 20 72 65 74 75 72 6e 20 | 61 73 73 69 67 6e 56 61 | return |assignVa|
|000050d0| 72 69 61 62 6c 65 45 72 | 72 6f 72 3b 0d 09 7d 0d |riableEr|ror;..}.|
|000050e0| 09 72 65 74 75 72 6e 20 | 30 3b 0d 7d 0d 0d 69 6e |.return |0;.}..in|
|000050f0| 74 20 55 6e 65 71 75 61 | 6c 44 65 73 63 72 69 62 |t Unequa|lDescrib|
|00005100| 65 64 56 61 72 73 28 44 | 65 73 63 72 69 70 74 69 |edVars(D|escripti|
|00005110| 6f 6e 20 64 31 5b 5d 2c | 44 65 73 63 72 69 70 74 |on d1[],|Descript|
|00005120| 69 6f 6e 20 64 32 5b 5d | 2c 73 68 6f 72 74 20 66 |ion d2[]|,short f|
|00005130| 6c 61 67 73 29 0d 2f 2a | 0d 43 6f 6d 70 61 72 65 |lags)./*|.Compare|
|00005140| 73 20 74 68 65 20 64 61 | 74 61 20 70 6f 69 6e 74 |s the da|ta point|
|00005150| 65 64 20 74 6f 20 62 79 | 20 74 68 65 20 74 77 6f |ed to by| the two|
|00005160| 20 44 65 73 63 72 69 70 | 74 69 6f 6e 20 61 72 72 | Descrip|tion arr|
|00005170| 61 79 73 20 61 6e 64 20 | 72 65 74 75 72 6e 73 0d |ays and |returns.|
|00005180| 74 72 75 65 20 69 66 20 | 74 68 65 20 73 74 72 75 |true if |the stru|
|00005190| 63 74 73 20 61 72 65 20 | 6c 65 67 61 6c 20 61 6e |cts are |legal an|
|000051a0| 64 20 74 68 65 20 64 61 | 74 61 20 61 72 65 20 65 |d the da|ta are e|
|000051b0| 71 75 61 6c 2c 20 66 61 | 6c 73 65 20 6f 74 68 65 |qual, fa|lse othe|
|000051c0| 72 77 69 73 65 2e 0d 2a | 2f 0d 7b 0d 09 69 6e 74 |rwise..*|/.{..int|
|000051d0| 20 65 72 72 6f 72 3b 0d | 09 0d 09 66 6f 72 28 3b | error;.|...for(;|
|000051e0| 64 31 2d 3e 74 79 70 65 | 21 3d 30 20 26 26 20 64 |d1->type|!=0 && d|
|000051f0| 32 2d 3e 74 79 70 65 21 | 3d 30 3b 64 31 2b 2b 2c |2->type!|=0;d1++,|
|00005200| 64 32 2b 2b 29 7b 0d 09 | 09 65 72 72 6f 72 3d 55 |d2++){..|.error=U|
|00005210| 6e 65 71 75 61 6c 44 65 | 73 63 72 69 62 65 64 56 |nequalDe|scribedV|
|00005220| 61 72 50 61 69 72 28 64 | 31 2c 64 32 2c 66 6c 61 |arPair(d|1,d2,fla|
|00005230| 67 73 29 3b 0d 09 09 69 | 66 28 65 72 72 6f 72 29 |gs);...i|f(error)|
|00005240| 72 65 74 75 72 6e 20 65 | 72 72 6f 72 3b 0d 09 7d |return e|rror;..}|
|00005250| 0d 09 72 65 74 75 72 6e | 20 30 3b 0d 7d 0d 0d 69 |..return| 0;.}..i|
|00005260| 6e 74 20 43 6f 70 79 44 | 65 73 63 72 69 62 65 64 |nt CopyD|escribed|
|00005270| 56 61 72 73 28 44 65 73 | 63 72 69 70 74 69 6f 6e |Vars(Des|cription|
|00005280| 20 64 31 5b 5d 2c 44 65 | 73 63 72 69 70 74 69 6f | d1[],De|scriptio|
|00005290| 6e 20 64 32 5b 5d 2c 73 | 68 6f 72 74 20 66 6c 61 |n d2[],s|hort fla|
|000052a0| 67 73 29 0d 2f 2a 0d 43 | 6f 70 69 65 73 20 74 68 |gs)./*.C|opies th|
|000052b0| 65 20 64 61 74 61 20 70 | 6f 69 6e 74 65 64 20 74 |e data p|ointed t|
|000052c0| 6f 20 62 79 20 74 68 65 | 20 66 69 72 73 74 20 44 |o by the| first D|
|000052d0| 65 73 63 72 69 70 74 69 | 6f 6e 20 61 72 72 61 79 |escripti|on array|
|000052e0| 2c 20 6f 76 65 72 77 72 | 69 74 69 6e 67 20 74 68 |, overwr|iting th|
|000052f0| 65 20 64 61 74 61 0d 70 | 6f 69 6e 74 65 64 20 74 |e data.p|ointed t|
|00005300| 6f 20 62 79 20 74 68 65 | 20 73 65 63 6f 6e 64 2e |o by the| second.|
|00005310| 20 52 65 74 75 72 6e 73 | 20 30 20 69 66 20 73 75 | Returns| 0 if su|
|00005320| 63 63 65 73 73 66 75 6c | 2c 20 69 2e 65 2e 20 74 |ccessful|, i.e. t|
|00005330| 68 65 20 73 74 72 75 63 | 74 73 20 61 72 65 20 6c |he struc|ts are l|
|00005340| 65 67 61 6c 20 61 6e 64 | 20 0d 74 68 65 20 74 79 |egal and| .the ty|
|00005350| 70 65 73 20 61 6e 64 20 | 6e 61 6d 65 73 20 61 72 |pes and |names ar|
|00005360| 65 20 63 6f 6e 73 69 73 | 74 65 6e 74 2c 20 6e 6f |e consis|tent, no|
|00005370| 6e 7a 65 72 6f 20 6f 74 | 68 65 72 77 69 73 65 2e |nzero ot|herwise.|
|00005380| 0d 2a 2f 0d 7b 0d 09 69 | 6e 74 20 65 72 72 6f 72 |.*/.{..i|nt error|
|00005390| 3b 0d 09 0d 09 66 6f 72 | 28 3b 64 31 2d 3e 74 79 |;....for|(;d1->ty|
|000053a0| 70 65 21 3d 30 20 26 26 | 20 64 32 2d 3e 74 79 70 |pe!=0 &&| d2->typ|
|000053b0| 65 21 3d 30 3b 64 31 2b | 2b 2c 64 32 2b 2b 29 7b |e!=0;d1+|+,d2++){|
|000053c0| 0d 09 09 65 72 72 6f 72 | 3d 43 6f 70 79 44 65 73 |...error|=CopyDes|
|000053d0| 63 72 69 62 65 64 56 61 | 72 50 61 69 72 28 64 31 |cribedVa|rPair(d1|
|000053e0| 2c 64 32 2c 66 6c 61 67 | 73 29 3b 0d 09 09 69 66 |,d2,flag|s);...if|
|000053f0| 28 65 72 72 6f 72 29 72 | 65 74 75 72 6e 20 65 72 |(error)r|eturn er|
|00005400| 72 6f 72 3b 0d 09 7d 0d | 09 72 65 74 75 72 6e 20 |ror;..}.|.return |
|00005410| 30 3b 0d 7d 0d 0d 6c 6f | 6e 67 20 45 6c 65 6d 65 |0;.}..lo|ng Eleme|
|00005420| 6e 74 73 28 44 65 73 63 | 72 69 70 74 69 6f 6e 20 |nts(Desc|ription |
|00005430| 2a 64 29 0d 7b 0d 09 6c | 6f 6e 67 20 65 6c 65 6d |*d).{..l|ong elem|
|00005440| 65 6e 74 73 3d 31 3b 0d | 09 69 6e 74 20 69 3b 0d |ents=1;.|.int i;.|
|00005450| 0d 09 66 6f 72 28 69 3d | 30 3b 69 3c 41 53 53 49 |..for(i=|0;i<ASSI|
|00005460| 47 4e 5f 44 49 4d 53 20 | 26 26 20 64 2d 3e 64 69 |GN_DIMS |&& d->di|
|00005470| 6d 5b 69 5d 3e 30 3b 69 | 2b 2b 29 65 6c 65 6d 65 |m[i]>0;i|++)eleme|
|00005480| 6e 74 73 2a 3d 64 2d 3e | 64 69 6d 5b 69 5d 3b 0d |nts*=d->|dim[i];.|
|00005490| 09 72 65 74 75 72 6e 20 | 65 6c 65 6d 65 6e 74 73 |.return |elements|
|000054a0| 3b 0d 7d 0d 6c 6f 6e 67 | 20 44 69 6d 73 28 44 65 |;.}.long| Dims(De|
|000054b0| 73 63 72 69 70 74 69 6f | 6e 20 2a 64 29 0d 7b 0d |scriptio|n *d).{.|
|000054c0| 09 69 6e 74 20 69 3b 0d | 0d 09 66 6f 72 28 69 3d |.int i;.|..for(i=|
|000054d0| 30 3b 69 3c 41 53 53 49 | 47 4e 5f 44 49 4d 53 20 |0;i<ASSI|GN_DIMS |
|000054e0| 26 26 20 64 2d 3e 64 69 | 6d 5b 69 5d 3e 30 3b 69 |&& d->di|m[i]>0;i|
|000054f0| 2b 2b 29 20 3b 0d 09 72 | 65 74 75 72 6e 20 69 3b |++) ;..r|eturn i;|
|00005500| 0d 7d 0d 76 6f 69 64 20 | 2a 45 6c 65 6d 65 6e 74 |.}.void |*Element|
|00005510| 50 74 72 28 44 65 73 63 | 72 69 70 74 69 6f 6e 20 |Ptr(Desc|ription |
|00005520| 2a 64 2c 6c 6f 6e 67 20 | 69 6e 64 65 78 29 0d 2f |*d,long |index)./|
|00005530| 2a 20 52 65 74 75 72 6e | 73 20 4e 55 4c 4c 20 69 |* Return|s NULL i|
|00005540| 66 20 50 74 72 54 79 70 | 65 20 61 72 72 61 79 20 |f PtrTyp|e array |
|00005550| 6e 6f 74 20 61 6c 6c 6f | 63 61 74 65 64 2e 20 2a |not allo|cated. *|
|00005560| 2f 0d 7b 0d 09 63 68 61 | 72 20 2a 70 74 72 3b 0d |/.{..cha|r *ptr;.|
|00005570| 09 0d 09 69 66 28 49 73 | 50 74 72 28 64 2d 3e 74 |...if(Is|Ptr(d->t|
|00005580| 79 70 65 29 29 7b 0d 09 | 09 61 73 73 65 72 74 28 |ype)){..|.assert(|
|00005590| 64 2d 3e 70 74 72 21 3d | 4e 55 4c 4c 29 3b 0d 09 |d->ptr!=|NULL);..|
|000055a0| 09 70 74 72 3d 2a 28 76 | 6f 69 64 20 2a 2a 29 64 |.ptr=*(v|oid **)d|
|000055b0| 2d 3e 70 74 72 3b 0d 09 | 7d 65 6c 73 65 20 70 74 |->ptr;..|}else pt|
|000055c0| 72 3d 64 2d 3e 70 74 72 | 3b 0d 09 69 66 28 70 74 |r=d->ptr|;..if(pt|
|000055d0| 72 21 3d 4e 55 4c 4c 20 | 26 26 20 64 2d 3e 64 69 |r!=NULL |&& d->di|
|000055e0| 6d 5b 30 5d 3e 30 29 7b | 0d 09 09 69 6e 64 65 78 |m[0]>0){|...index|
|000055f0| 2b 3d 64 2d 3e 66 69 72 | 73 74 45 6c 65 6d 65 6e |+=d->fir|stElemen|
|00005600| 74 3b 0d 09 09 70 74 72 | 2b 3d 69 6e 64 65 78 2a |t;...ptr|+=index*|
|00005610| 74 79 70 65 53 69 7a 65 | 5b 64 2d 3e 74 79 70 65 |typeSize|[d->type|
|00005620| 5d 3b 0d 09 7d 0d 09 72 | 65 74 75 72 6e 20 70 74 |];..}..r|eturn pt|
|00005630| 72 3b 0d 7d 0d 63 68 61 | 72 20 2a 45 6c 65 6d 65 |r;.}.cha|r *Eleme|
|00005640| 6e 74 4e 61 6d 65 28 63 | 68 61 72 20 2a 73 2c 44 |ntName(c|har *s,D|
|00005650| 65 73 63 72 69 70 74 69 | 6f 6e 20 2a 64 2c 6c 6f |escripti|on *d,lo|
|00005660| 6e 67 20 69 6e 64 65 78 | 29 0d 7b 0d 09 6c 6f 6e |ng index|).{..lon|
|00005670| 67 20 73 75 62 5b 41 53 | 53 49 47 4e 5f 44 49 4d |g sub[AS|SIGN_DIM|
|00005680| 53 5d 3b 0d 09 69 6e 74 | 20 69 3b 0d 09 0d 09 45 |S];..int| i;....E|
|00005690| 6c 65 6d 65 6e 74 53 75 | 62 73 63 72 69 70 74 28 |lementSu|bscript(|
|000056a0| 64 2c 69 6e 64 65 78 2c | 73 75 62 29 3b 0d 09 73 |d,index,|sub);..s|
|000056b0| 70 72 69 6e 74 66 28 73 | 2c 22 25 73 22 2c 64 2d |printf(s|,"%s",d-|
|000056c0| 3e 6e 61 6d 65 29 3b 0d | 09 66 6f 72 28 69 3d 30 |>name);.|.for(i=0|
|000056d0| 3b 69 3c 44 69 6d 73 28 | 64 29 3b 69 2b 2b 29 73 |;i<Dims(|d);i++)s|
|000056e0| 70 72 69 6e 74 66 28 73 | 2c 22 25 73 5b 25 6c 64 |printf(s|,"%s[%ld|
|000056f0| 5d 22 2c 73 2c 73 75 62 | 5b 69 5d 29 3b 0d 09 72 |]",s,sub|[i]);..r|
|00005700| 65 74 75 72 6e 20 73 3b | 0d 7d 0d 63 68 61 72 20 |eturn s;|.}.char |
|00005710| 2a 44 65 73 63 72 69 70 | 74 69 6f 6e 4e 61 6d 65 |*Descrip|tionName|
|00005720| 44 69 6d 65 6e 73 69 6f | 6e 73 28 44 65 73 63 72 |Dimensio|ns(Descr|
|00005730| 69 70 74 69 6f 6e 20 2a | 64 29 3b 0d 63 68 61 72 |iption *|d);.char|
|00005740| 20 2a 44 65 73 63 72 69 | 70 74 69 6f 6e 4e 61 6d | *Descri|ptionNam|
|00005750| 65 44 69 6d 65 6e 73 69 | 6f 6e 73 28 44 65 73 63 |eDimensi|ons(Desc|
|00005760| 72 69 70 74 69 6f 6e 20 | 2a 64 29 0d 7b 0d 09 69 |ription |*d).{..i|
|00005770| 6e 74 20 69 3b 0d 09 73 | 74 61 74 69 63 20 63 68 |nt i;..s|tatic ch|
|00005780| 61 72 20 73 5b 36 34 5d | 3b 0d 09 0d 09 73 70 72 |ar s[64]|;....spr|
|00005790| 69 6e 74 66 28 73 2c 22 | 25 73 22 2c 64 2d 3e 6e |intf(s,"|%s",d->n|
|000057a0| 61 6d 65 29 3b 0d 09 66 | 6f 72 28 69 3d 30 3b 64 |ame);..f|or(i=0;d|
|000057b0| 2d 3e 64 69 6d 5b 69 5d | 3e 30 3b 69 2b 2b 29 73 |->dim[i]|>0;i++)s|
|000057c0| 70 72 69 6e 74 66 28 73 | 2c 22 25 73 5b 25 6c 64 |printf(s|,"%s[%ld|
|000057d0| 5d 22 2c 73 2c 64 2d 3e | 64 69 6d 5b 69 5d 29 3b |]",s,d->|dim[i]);|
|000057e0| 0d 09 61 73 73 65 72 74 | 28 73 74 72 6c 65 6e 28 |..assert|(strlen(|
|000057f0| 73 29 3c 73 69 7a 65 6f | 66 28 73 29 29 3b 0d 09 |s)<sizeo|f(s));..|
|00005800| 72 65 74 75 72 6e 20 73 | 3b 0d 7d 0d 76 6f 69 64 |return s|;.}.void|
|00005810| 20 45 6c 65 6d 65 6e 74 | 53 75 62 73 63 72 69 70 | Element|Subscrip|
|00005820| 74 28 44 65 73 63 72 69 | 70 74 69 6f 6e 20 2a 64 |t(Descri|ption *d|
|00005830| 2c 6c 6f 6e 67 20 69 6e | 64 65 78 2c 6c 6f 6e 67 |,long in|dex,long|
|00005840| 20 73 75 62 5b 41 53 53 | 49 47 4e 5f 44 49 4d 53 | sub[ASS|IGN_DIMS|
|00005850| 5d 29 0d 7b 0d 09 69 6e | 74 20 69 3b 0d 0d 09 66 |]).{..in|t i;...f|
|00005860| 6f 72 28 69 3d 30 3b 69 | 3c 41 53 53 49 47 4e 5f |or(i=0;i|<ASSIGN_|
|00005870| 44 49 4d 53 3b 69 2b 2b | 29 73 75 62 5b 69 5d 3d |DIMS;i++|)sub[i]=|
|00005880| 30 3b 0d 09 69 66 28 44 | 69 6d 73 28 64 29 29 7b |0;..if(D|ims(d)){|
|00005890| 0d 09 09 66 6f 72 28 69 | 3d 44 69 6d 73 28 64 29 |...for(i|=Dims(d)|
|000058a0| 2d 31 3b 69 3e 3d 30 3b | 69 2d 2d 29 7b 0d 09 09 |-1;i>=0;|i--){...|
|000058b0| 09 73 75 62 5b 69 5d 3d | 69 6e 64 65 78 25 64 2d |.sub[i]=|index%d-|
|000058c0| 3e 64 69 6d 5b 69 5d 3b | 0d 09 09 09 69 6e 64 65 |>dim[i];|....inde|
|000058d0| 78 2f 3d 64 2d 3e 64 69 | 6d 5b 69 5d 3b 0d 09 09 |x/=d->di|m[i];...|
|000058e0| 7d 0d 09 09 73 75 62 5b | 44 69 6d 73 28 64 29 2d |}...sub[|Dims(d)-|
|000058f0| 31 5d 2b 3d 64 2d 3e 66 | 69 72 73 74 45 6c 65 6d |1]+=d->f|irstElem|
|00005900| 65 6e 74 3b 0d 09 7d 0d | 7d 0d 6c 6f 6e 67 20 45 |ent;..}.|}.long E|
|00005910| 6c 65 6d 65 6e 74 49 6e | 64 65 78 28 44 65 73 63 |lementIn|dex(Desc|
|00005920| 72 69 70 74 69 6f 6e 20 | 2a 64 2c 6c 6f 6e 67 20 |ription |*d,long |
|00005930| 73 75 62 5b 41 53 53 49 | 47 4e 5f 44 49 4d 53 5d |sub[ASSI|GN_DIMS]|
|00005940| 29 0d 7b 0d 09 69 6e 74 | 20 69 3b 0d 09 6c 6f 6e |).{..int| i;..lon|
|00005950| 67 20 69 6e 64 65 78 3d | 30 3b 0d 0d 09 69 66 28 |g index=|0;...if(|
|00005960| 44 69 6d 73 28 64 29 29 | 7b 0d 09 73 75 62 5b 44 |Dims(d))|{..sub[D|
|00005970| 69 6d 73 28 64 29 2d 31 | 5d 2d 3d 64 2d 3e 66 69 |ims(d)-1|]-=d->fi|
|00005980| 72 73 74 45 6c 65 6d 65 | 6e 74 3b 0d 09 66 6f 72 |rstEleme|nt;..for|
|00005990| 28 69 3d 30 3b 69 3c 44 | 69 6d 73 28 64 29 3b 69 |(i=0;i<D|ims(d);i|
|000059a0| 2b 2b 29 7b 0d 09 09 69 | 6e 64 65 78 2a 3d 64 2d |++){...i|ndex*=d-|
|000059b0| 3e 64 69 6d 5b 69 5d 3b | 0d 09 09 69 6e 64 65 78 |>dim[i];|...index|
|000059c0| 2b 3d 73 75 62 5b 69 5d | 3b 0d 09 7d 0d 09 73 75 |+=sub[i]|;..}..su|
|000059d0| 62 5b 44 69 6d 73 28 64 | 29 2d 31 5d 2b 3d 64 2d |b[Dims(d|)-1]+=d-|
|000059e0| 3e 66 69 72 73 74 45 6c | 65 6d 65 6e 74 3b 0d 09 |>firstEl|ement;..|
|000059f0| 7d 0d 09 72 65 74 75 72 | 6e 20 69 6e 64 65 78 3b |}..retur|n index;|
|00005a00| 0d 7d 0d 69 6e 74 20 47 | 65 74 44 69 6d 65 6e 73 |.}.int G|etDimens|
|00005a10| 69 6f 6e 73 28 44 65 73 | 63 72 69 70 74 69 6f 6e |ions(Des|cription|
|00005a20| 20 2a 64 2c 69 6e 74 20 | 73 75 62 73 63 72 69 70 | *d,int |subscrip|
|00005a30| 74 44 69 6d 73 2c 6c 6f | 6e 67 20 73 75 62 73 63 |tDims,lo|ng subsc|
|00005a40| 72 69 70 74 5b 41 53 53 | 49 47 4e 5f 44 49 4d 53 |ript[ASS|IGN_DIMS|
|00005a50| 5d 2c 73 68 6f 72 74 20 | 66 6c 61 67 73 29 0d 7b |],short |flags).{|
|00005a60| 0d 09 73 68 6f 72 74 20 | 69 3b 0d 09 0d 09 66 6c |..short |i;....fl|
|00005a70| 61 67 73 3b 09 2f 2a 20 | 64 67 70 3a 20 70 72 65 |ags;./* |dgp: pre|
|00005a80| 76 65 6e 74 20 22 75 6e | 75 73 65 64 20 61 72 67 |vent "un|used arg|
|00005a90| 75 6d 65 6e 74 22 20 77 | 61 72 6e 69 6e 67 20 2a |ument" w|arning *|
|00005aa0| 2f 0d 09 69 66 28 64 2d | 3e 73 69 7a 65 64 4f 6e |/..if(d-|>sizedOn|
|00005ab0| 63 65 20 26 26 20 44 69 | 6d 73 28 64 29 21 3d 73 |ce && Di|ms(d)!=s|
|00005ac0| 75 62 73 63 72 69 70 74 | 44 69 6d 73 29 0d 09 09 |ubscript|Dims)...|
|00005ad0| 72 65 74 75 72 6e 20 61 | 73 73 69 67 6e 49 6e 63 |return a|ssignInc|
|00005ae0| 6f 6e 73 69 73 74 65 6e | 74 44 69 6d 65 6e 73 69 |onsisten|tDimensi|
|00005af0| 6f 6e 73 45 72 72 6f 72 | 3b 0d 09 69 66 28 21 64 |onsError|;..if(!d|
|00005b00| 2d 3e 73 69 7a 65 64 29 | 7b 0d 09 09 66 6f 72 28 |->sized)|{...for(|
|00005b10| 69 3d 30 3b 69 3c 73 75 | 62 73 63 72 69 70 74 44 |i=0;i<su|bscriptD|
|00005b20| 69 6d 73 3b 69 2b 2b 29 | 0d 09 09 09 69 66 28 64 |ims;i++)|....if(d|
|00005b30| 2d 3e 64 69 6d 5b 69 5d | 3c 73 75 62 73 63 72 69 |->dim[i]|<subscri|
|00005b40| 70 74 5b 69 5d 2b 31 29 | 64 2d 3e 64 69 6d 5b 69 |pt[i]+1)|d->dim[i|
|00005b50| 5d 3d 73 75 62 73 63 72 | 69 70 74 5b 69 5d 2b 31 |]=subscr|ipt[i]+1|
|00005b60| 3b 0d 09 09 64 2d 3e 73 | 69 7a 65 64 4f 6e 63 65 |;...d->s|izedOnce|
|00005b70| 3d 31 3b 0d 09 7d 0d 09 | 72 65 74 75 72 6e 20 30 |=1;..}..|return 0|
|00005b80| 3b 0d 7d 0d 0d 69 6e 74 | 20 55 6e 65 71 75 61 6c |;.}..int| Unequal|
|00005b90| 44 65 73 63 72 69 62 65 | 64 56 61 72 50 61 69 72 |Describe|dVarPair|
|00005ba0| 28 44 65 73 63 72 69 70 | 74 69 6f 6e 20 2a 64 31 |(Descrip|tion *d1|
|00005bb0| 2c 44 65 73 63 72 69 70 | 74 69 6f 6e 20 2a 64 32 |,Descrip|tion *d2|
|00005bc0| 2c 73 68 6f 72 74 20 66 | 6c 61 67 73 29 0d 2f 2a |,short f|lags)./*|
|00005bd0| 0d 43 6f 6d 70 61 72 65 | 73 20 74 68 65 20 64 61 |.Compare|s the da|
|00005be0| 74 61 20 70 6f 69 6e 74 | 65 64 20 74 6f 20 62 79 |ta point|ed to by|
|00005bf0| 20 74 68 65 20 74 77 6f | 20 44 65 73 63 72 69 70 | the two| Descrip|
|00005c00| 74 69 6f 6e 20 73 74 72 | 75 63 74 73 20 61 6e 64 |tion str|ucts and|
|00005c10| 20 72 65 74 75 72 6e 73 | 20 74 72 75 65 20 69 66 | returns| true if|
|00005c20| 20 74 68 65 0d 73 74 72 | 75 63 74 73 20 61 72 65 | the.str|ucts are|
|00005c30| 20 6c 65 67 61 6c 20 61 | 6e 64 20 74 68 65 20 64 | legal a|nd the d|
|00005c40| 61 74 61 20 61 72 65 20 | 65 71 75 61 6c 2c 20 66 |ata are |equal, f|
|00005c50| 61 6c 73 65 20 6f 74 68 | 65 72 77 69 73 65 2e 20 |alse oth|erwise. |
|00005c60| 43 6f 6d 70 61 72 69 73 | 6f 6e 20 6f 66 20 66 6c |Comparis|on of fl|
|00005c70| 6f 61 74 73 0d 61 6e 64 | 20 64 6f 75 62 6c 65 73 |oats.and| doubles|
|00005c80| 20 61 6c 6c 6f 77 73 20 | 61 20 74 6f 6c 65 72 61 | allows |a tolera|
|00005c90| 6e 63 65 20 6f 66 20 2b | 2f 2d 20 6f 6e 65 20 70 |nce of +|/- one p|
|00005ca0| 61 72 74 20 69 6e 20 61 | 20 6d 69 6c 6c 69 6f 6e |art in a| million|
|00005cb0| 2d 2d 62 65 63 61 75 73 | 65 20 63 6f 6e 76 65 72 |--becaus|e conver|
|00005cc0| 74 69 6e 67 0d 74 6f 20 | 61 6e 64 20 66 72 6f 6d |ting.to |and from|
|00005cd0| 20 64 65 63 69 6d 61 6c | 20 6d 61 79 20 6c 6f 73 | decimal| may los|
|00005ce0| 65 20 73 6f 6d 65 20 70 | 72 65 63 69 73 69 6f 6e |e some p|recision|
|00005cf0| 2d 2d 61 6e 64 20 69 67 | 6e 6f 72 65 73 20 61 6e |--and ig|nores an|
|00005d00| 79 20 4e 41 4e 73 27 20 | 69 6e 64 69 63 65 73 20 |y NANs' |indices |
|00005d10| 28 4e 41 4e 30 34 0d 76 | 73 20 4e 41 4e 46 46 29 |(NAN04.v|s NANFF)|
|00005d20| 2d 2d 62 65 63 61 75 73 | 65 20 74 68 65 79 27 72 |--becaus|e they'r|
|00005d30| 65 20 6e 6f 74 20 70 72 | 65 73 65 72 76 65 64 2e |e not pr|eserved.|
|00005d40| 0d 2a 2f 0d 7b 0d 09 75 | 6e 73 69 67 6e 65 64 20 |.*/.{..u|nsigned |
|00005d50| 63 68 61 72 20 2a 70 31 | 2c 2a 70 32 3b 0d 09 6c |char *p1|,*p2;..l|
|00005d60| 6f 6e 67 20 69 2c 73 69 | 7a 65 2c 65 6c 65 6d 65 |ong i,si|ze,eleme|
|00005d70| 6e 74 73 3b 0d 09 69 6e | 74 20 65 72 72 6f 72 3b |nts;..in|t error;|
|00005d80| 0d 09 64 6f 75 62 6c 65 | 20 61 2c 62 2c 65 3b 0d |..double| a,b,e;.|
|00005d90| 09 73 74 61 74 69 63 20 | 63 6f 6e 73 74 20 63 68 |.static |const ch|
|00005da0| 61 72 20 68 65 72 65 5b | 5d 3d 22 55 6e 65 71 75 |ar here[|]="Unequ|
|00005db0| 61 6c 44 65 73 63 72 69 | 62 65 64 56 61 72 50 61 |alDescri|bedVarPa|
|00005dc0| 69 72 22 3b 0d 09 63 68 | 61 72 20 6e 61 6d 65 5b |ir";..ch|ar name[|
|00005dd0| 33 32 2b 31 36 2a 41 53 | 53 49 47 4e 5f 44 49 4d |32+16*AS|SIGN_DIM|
|00005de0| 53 5d 3b 0d 09 0d 09 2f | 2a 20 53 71 75 65 65 7a |S];..../|* Squeez|
|00005df0| 65 20 73 70 61 63 65 20 | 6f 75 74 20 6f 66 20 6e |e space |out of n|
|00005e00| 61 6d 65 73 20 2a 2f 0d | 09 65 72 72 6f 72 3d 43 |ames */.|.error=C|
|00005e10| 68 65 63 6b 41 44 65 73 | 63 72 69 70 74 69 6f 6e |heckADes|cription|
|00005e20| 28 64 31 2c 68 65 72 65 | 2c 66 6c 61 67 73 29 3b |(d1,here|,flags);|
|00005e30| 0d 09 69 66 28 65 72 72 | 6f 72 3c 30 29 72 65 74 |..if(err|or<0)ret|
|00005e40| 75 72 6e 20 65 72 72 6f | 72 3b 0d 09 65 72 72 6f |urn erro|r;..erro|
|00005e50| 72 3d 43 68 65 63 6b 41 | 44 65 73 63 72 69 70 74 |r=CheckA|Descript|
|00005e60| 69 6f 6e 28 64 32 2c 68 | 65 72 65 2c 66 6c 61 67 |ion(d2,h|ere,flag|
|00005e70| 73 29 3b 0d 09 69 66 28 | 65 72 72 6f 72 3c 30 29 |s);..if(|error<0)|
|00005e80| 72 65 74 75 72 6e 20 65 | 72 72 6f 72 3b 0d 09 69 |return e|rror;..i|
|00005e90| 66 28 64 31 2d 3e 74 79 | 70 65 21 3d 64 32 2d 3e |f(d1->ty|pe!=d2->|
|00005ea0| 74 79 70 65 0d 09 09 7c | 7c 20 21 73 74 72 65 71 |type...||| !streq|
|00005eb0| 28 64 31 2d 3e 6e 61 6d | 65 2c 64 32 2d 3e 6e 61 |(d1->nam|e,d2->na|
|00005ec0| 6d 65 29 20 0d 09 09 7c | 7c 20 64 31 2d 3e 66 69 |me) ...||| d1->fi|
|00005ed0| 72 73 74 45 6c 65 6d 65 | 6e 74 21 3d 64 32 2d 3e |rstEleme|nt!=d2->|
|00005ee0| 66 69 72 73 74 45 6c 65 | 6d 65 6e 74 0d 09 09 7c |firstEle|ment...||
|00005ef0| 7c 20 21 73 74 72 65 71 | 28 64 31 2d 3e 63 6f 6d || !streq|(d1->com|
|00005f00| 6d 65 6e 74 2c 64 32 2d | 3e 63 6f 6d 6d 65 6e 74 |ment,d2-|>comment|
|00005f10| 29 29 0d 09 09 09 7b 65 | 72 72 6f 72 3d 61 73 73 |))....{e|rror=ass|
|00005f20| 69 67 6e 49 6e 63 6f 6e | 73 69 73 74 65 6e 74 44 |ignIncon|sistentD|
|00005f30| 65 73 63 72 69 70 74 69 | 6f 6e 73 45 72 72 6f 72 |escripti|onsError|
|00005f40| 3b 67 6f 74 6f 20 64 6f | 6e 65 3b 7d 0d 09 66 6f |;goto do|ne;}..fo|
|00005f50| 72 28 69 3d 30 3b 69 3c | 41 53 53 49 47 4e 5f 44 |r(i=0;i<|ASSIGN_D|
|00005f60| 49 4d 53 3b 69 2b 2b 29 | 69 66 28 64 31 2d 3e 64 |IMS;i++)|if(d1->d|
|00005f70| 69 6d 5b 69 5d 21 3d 64 | 32 2d 3e 64 69 6d 5b 69 |im[i]!=d|2->dim[i|
|00005f80| 5d 29 0d 09 09 7b 65 72 | 72 6f 72 3d 61 73 73 69 |])...{er|ror=assi|
|00005f90| 67 6e 49 6e 63 6f 6e 73 | 69 73 74 65 6e 74 44 65 |gnIncons|istentDe|
|00005fa0| 73 63 72 69 70 74 69 6f | 6e 73 45 72 72 6f 72 3b |scriptio|nsError;|
|00005fb0| 67 6f 74 6f 20 64 6f 6e | 65 3b 7d 0d 09 70 31 3d |goto don|e;}..p1=|
|00005fc0| 45 6c 65 6d 65 6e 74 50 | 74 72 28 64 31 2c 30 29 |ElementP|tr(d1,0)|
|00005fd0| 3b 0d 09 70 32 3d 45 6c | 65 6d 65 6e 74 50 74 72 |;..p2=El|ementPtr|
|00005fe0| 28 64 32 2c 30 29 3b 0d | 09 73 69 7a 65 3d 74 79 |(d2,0);.|.size=ty|
|00005ff0| 70 65 53 69 7a 65 5b 64 | 31 2d 3e 74 79 70 65 5d |peSize[d|1->type]|
|00006000| 3b 0d 09 65 6c 65 6d 65 | 6e 74 73 3d 45 6c 65 6d |;..eleme|nts=Elem|
|00006010| 65 6e 74 73 28 64 31 29 | 3b 0d 09 69 66 28 21 49 |ents(d1)|;..if(!I|
|00006020| 73 53 74 72 69 6e 67 28 | 64 31 2d 3e 74 79 70 65 |sString(|d1->type|
|00006030| 29 29 7b 0d 09 09 69 66 | 28 6d 65 6d 63 6d 70 28 |)){...if|(memcmp(|
|00006040| 70 31 2c 70 32 2c 73 69 | 7a 65 2a 65 6c 65 6d 65 |p1,p2,si|ze*eleme|
|00006050| 6e 74 73 29 21 3d 30 29 | 7b 0d 09 09 09 69 66 28 |nts)!=0)|{....if(|
|00006060| 21 49 73 46 6c 6f 61 74 | 69 6e 67 28 64 31 2d 3e |!IsFloat|ing(d1->|
|00006070| 74 79 70 65 29 29 7b 65 | 72 72 6f 72 3d 61 73 73 |type)){e|rror=ass|
|00006080| 69 67 6e 55 6e 65 71 75 | 61 6c 44 61 74 61 45 72 |ignUnequ|alDataEr|
|00006090| 72 6f 72 3b 67 6f 74 6f | 20 64 6f 6e 65 3b 7d 0d |ror;goto| done;}.|
|000060a0| 09 09 09 66 6f 72 28 69 | 3d 30 3b 69 3c 65 6c 65 |...for(i|=0;i<ele|
|000060b0| 6d 65 6e 74 73 3b 69 2b | 2b 29 7b 0d 09 09 09 09 |ments;i+|+){.....|
|000060c0| 73 77 69 74 63 68 28 64 | 31 2d 3e 74 79 70 65 29 |switch(d|1->type)|
|000060d0| 7b 0d 09 09 09 09 63 61 | 73 65 20 66 6c 6f 61 74 |{.....ca|se float|
|000060e0| 54 79 70 65 3a 0d 09 09 | 09 09 09 61 3d 2a 28 66 |Type:...|...a=*(f|
|000060f0| 6c 6f 61 74 20 2a 29 70 | 31 3b 0d 09 09 09 09 09 |loat *)p|1;......|
|00006100| 62 3d 2a 28 66 6c 6f 61 | 74 20 2a 29 70 32 3b 0d |b=*(floa|t *)p2;.|
|00006110| 09 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 09 |.....bre|ak;.....|
|00006120| 23 69 66 20 53 48 4f 52 | 54 5f 44 4f 55 42 4c 45 |#if SHOR|T_DOUBLE|
|00006130| 5f 4f 4b 0d 09 09 09 09 | 09 63 61 73 65 20 73 68 |_OK.....|.case sh|
|00006140| 6f 72 74 44 6f 75 62 6c | 65 54 79 70 65 3a 0d 09 |ortDoubl|eType:..|
|00006150| 09 09 09 09 09 61 3d 2a | 28 73 68 6f 72 74 20 64 |.....a=*|(short d|
|00006160| 6f 75 62 6c 65 20 2a 29 | 70 31 3b 0d 09 09 09 09 |ouble *)|p1;.....|
|00006170| 09 09 62 3d 2a 28 73 68 | 6f 72 74 20 64 6f 75 62 |..b=*(sh|ort doub|
|00006180| 6c 65 20 2a 29 70 32 3b | 0d 09 09 09 09 09 09 62 |le *)p2;|.......b|
|00006190| 72 65 61 6b 3b 0d 09 09 | 09 09 23 65 6e 64 69 66 |reak;...|..#endif|
|000061a0| 0d 09 09 09 09 63 61 73 | 65 20 64 6f 75 62 6c 65 |.....cas|e double|
|000061b0| 54 79 70 65 3a 0d 09 09 | 09 09 09 61 3d 2a 28 64 |Type:...|...a=*(d|
|000061c0| 6f 75 62 6c 65 20 2a 29 | 70 31 3b 0d 09 09 09 09 |ouble *)|p1;.....|
|000061d0| 09 62 3d 2a 28 64 6f 75 | 62 6c 65 20 2a 29 70 32 |.b=*(dou|ble *)p2|
|000061e0| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |;......b|reak;...|
|000061f0| 09 09 7d 0d 09 09 09 09 | 2f 2a 20 20 63 6f 6d 70 |..}.....|/* comp|
|00006200| 61 72 65 20 64 6f 75 62 | 6c 65 73 20 2a 2f 0d 09 |are doub|les */..|
|00006210| 09 09 09 2f 2a 20 20 69 | 67 6e 6f 72 65 20 4e 61 |.../* i|gnore Na|
|00006220| 4e 20 74 79 70 65 2c 20 | 73 69 6e 63 65 20 69 74 |N type, |since it|
|00006230| 27 73 20 6e 6f 74 20 70 | 72 65 73 65 72 76 65 64 |'s not p|reserved|
|00006240| 20 2a 2f 0d 09 09 09 09 | 69 66 28 49 73 4e 61 6e | */.....|if(IsNan|
|00006250| 28 61 29 3d 3d 30 20 7c | 7c 20 49 73 4e 61 6e 28 |(a)==0 ||| IsNan(|
|00006260| 62 29 3d 3d 30 29 7b 0d | 09 09 09 09 09 69 66 28 |b)==0){.|.....if(|
|00006270| 21 49 73 46 69 6e 69 74 | 65 28 61 29 20 7c 7c 20 |!IsFinit|e(a) || |
|00006280| 21 49 73 46 69 6e 69 74 | 65 28 62 29 29 0d 09 09 |!IsFinit|e(b))...|
|00006290| 09 09 09 09 7b 65 72 72 | 6f 72 3d 61 73 73 69 67 |....{err|or=assig|
|000062a0| 6e 55 6e 65 71 75 61 6c | 44 61 74 61 45 72 72 6f |nUnequal|DataErro|
|000062b0| 72 3b 67 6f 74 6f 20 64 | 6f 6e 65 3b 7d 0d 09 09 |r;goto d|one;}...|
|000062c0| 09 09 09 65 3d 61 2f 62 | 2d 31 2e 30 3b 0d 09 09 |...e=a/b|-1.0;...|
|000062d0| 09 09 09 69 66 28 65 3e | 54 4f 4c 45 52 41 4e 43 |...if(e>|TOLERANC|
|000062e0| 45 20 7c 7c 20 65 3c 2d | 54 4f 4c 45 52 41 4e 43 |E || e<-|TOLERANC|
|000062f0| 45 29 0d 09 09 09 09 09 | 09 7b 65 72 72 6f 72 3d |E)......|.{error=|
|00006300| 61 73 73 69 67 6e 55 6e | 65 71 75 61 6c 44 61 74 |assignUn|equalDat|
|00006310| 61 45 72 72 6f 72 3b 67 | 6f 74 6f 20 64 6f 6e 65 |aError;g|oto done|
|00006320| 3b 7d 0d 09 09 09 09 7d | 0d 09 09 09 09 70 31 2b |;}.....}|.....p1+|
|00006330| 3d 73 69 7a 65 3b 0d 09 | 09 09 09 70 32 2b 3d 73 |=size;..|...p2+=s|
|00006340| 69 7a 65 3b 0d 09 09 09 | 7d 0d 09 09 7d 0d 09 7d |ize;....|}...}..}|
|00006350| 65 6c 73 65 20 66 6f 72 | 28 69 3d 30 3b 69 3c 65 |else for|(i=0;i<e|
|00006360| 6c 65 6d 65 6e 74 73 3b | 69 2b 2b 29 7b 09 09 09 |lements;|i++){...|
|00006370| 09 09 09 09 2f 2a 20 63 | 6f 6d 70 61 72 65 20 73 |..../* c|ompare s|
|00006380| 74 72 69 6e 67 73 20 2a | 2f 0d 09 09 69 66 28 2a |trings *|/...if(*|
|00006390| 28 63 68 61 72 20 2a 2a | 29 70 31 21 3d 2a 28 63 |(char **|)p1!=*(c|
|000063a0| 68 61 72 20 2a 2a 29 70 | 32 29 7b 0d 09 09 09 69 |har **)p|2){....i|
|000063b0| 66 28 28 2a 28 63 68 61 | 72 20 2a 2a 29 70 31 3d |f((*(cha|r **)p1=|
|000063c0| 3d 4e 55 4c 4c 29 20 7c | 7c 20 28 2a 28 63 68 61 |=NULL) ||| (*(cha|
|000063d0| 72 20 2a 2a 29 70 32 3d | 3d 4e 55 4c 4c 29 0d 09 |r **)p2=|=NULL)..|
|000063e0| 09 09 09 7c 7c 20 21 73 | 74 72 65 71 28 2a 28 63 |...|| !s|treq(*(c|
|000063f0| 68 61 72 20 2a 2a 29 70 | 31 2c 2a 28 63 68 61 72 |har **)p|1,*(char|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.